Code:
select t.Name from Tracks t where t.AlbumId = ( select a.AlbumId from Albums a where a.Title = 'Californication')
What is the title of the 8th track?
Answer : Porcelain
Code:
select c.CustomerId, c.FirstName, c.LastName, c.City, c.Email, COUNT(i.InvoiceId) from Customers c join Invoices i on c.CustomerId = i.CustomerId Group by c.CustomerId;
After running the query described above, what is the email address of the 5th person, František Wichterlová? Enter the answer below (feel free to copy and paste)..
Answer : frantisekw@jetbrains.com
Code :
select t.Name, a.Title, ar.Name, t.TrackId from Artists ar inner join Albums a on ar.ArtistId = a.ArtistId inner join Tracks t on a.AlbumId = t.AlbumId;
What is the song title of trackID 12 from the "For Those About to Rock We Salute You" album? Enter the answer below.
Answer : Breaking The Rules
Code :
select mgr.LastName Manager, e.LastName Employee from Employees e left join Employees mgr on e.ReportsTo = mgr.EmployeeId
After running the query described above, who are the reports for the manager named Mitchell (select all that apply)?
Answer : King, Callahan
Code :
select a.Title, ar.Name, ar.ArtistId from Artists ar left join Albums a on ar.ArtistId = a.ArtistId where a.Title is NULL;
After running the query described above, two of the records returned have the same last name. Enter that name below.
Answer : Gilberto
Code :
select e.FirstName, e.LastName from Employees e UNION select c.FirstName, c.LastName from Customers c order by c.LastName DESC
After running the query described above, determine what is the last name of the 6th record? Enter it below. Remember to order things in descending order to be sure to get the correct answer.
Answer : Taylor
Code :
select c.CustomerId, c.FirstName, c.LastName, c.City from Customers c join Invoices i on c.CustomerId = i.CustomerId where c.City <> i.BillingCity;
Indicate your answer below..
Answer : No customers have a different city listed in their billing city versus customer city.