Lab 4. Functions
CS122, Summer 2008
(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 11:30am, 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 statement, or preferably, functions like ifnull().