Lab 4. Functions
CS122, Fall 2011
(30pt) Complete the following queries in SQL. Please put your
queries
in an SQL script file lab4.sql.
and upload it to CSNS
at the end of the lab. Note
that file uploading will be disabled
automatically after 4:00pm, and late submission will not be accepted.
- Chapter 5, p.138-139, Exercise 1-4, 6-10.
- Find the names of the studio contacts whose email domains do not
match their studio's web domains. For example, the email domain of Gardner Roberts is maketrax.com, which matches the studio's web domain maketrax.com, but Manuel Austin's email domain lonestarrec.com does not match the studio's web domain lsrecords.com.
Note that
- For Exercise 5.6, calculate the "age in years" as the year of entry date minus the year of the member's birthday.
- For Exercise 5.7 and 5.8, you may use CASE operator, or preferably, functions like ifnull().