Here
is a list of questions that we might want to ask of the database. After each, write ALL the SQL statements
that you would use to answer the question.
Your statements must get the information by extracting it from the
database; you may NOT look through the database yourself, determine the answer,
and then use SQL to make the database display the answer; your query must
continue to give the right answer even after the data in the database
change. For example, you may not answer
question B by figuring out that there are two album names that are repeated and
then using the query:
select
album_name from albums where album_name='Wolfgang Amadeus Mozart' OR
album_name='Ludwig Van Beethoven';
Your
results will be scored by copying the statements into the expression window and
executing them, so make sure there are no typos.
If
you create a temporary table and use it to answer more than one question, put
its creation SQL into both answers.
A.
show the album name that contains the longest track in each genre. one album
name per genre unless there is a tie - then show all that tie.
B.
show a list of all album names that are the names of more than one album. Each name should appear only once.
C.
show a list of all non-unique track names (if there are any)
D.
show a list of all albums where no track is under one minute long
E.
show the total playing time of each album.
F.
show a list of all the playing times that occur more than once.
G.
Show the shortest playing time in the database
H.
find the shortest track for each album that had classical music
I.
find the total time for classical music
J.
For every performer, give the total playing time
K.
which publisher released the album with the longest track recorded by two
performers, also give track name, length in hours
L.
album name, track name, playing time from any albums that contain ‘Mozart’ in
the album name
M.
show the track name, album name, playing time for highest track number on each
album.
N.
longest track by each performer