Question: Part 3: Using the database: Write SQL queries for each of the questions below. Upload one file containing all the 10 queries to ilearn by

Part 3: Using the database: Write SQL queries for each of the questions below. Upload one file containing all the 10 queries to ilearn by the due date. Query results are not required. Each question is worth 7.5 points. For each question the number of results that a correct query should retrieve are given for reference. 1. Find the genre which has at most 1 track. Print the name of such genre. Number of rows returned in the result = 1 2. Find the tracks that were purchased in California (CA) or Washington (WA). Print the name of such tracks. Number of rows returned in the result = 151 3. Find the tracks that have been purchased in quantities greater than 5. Print the name of such tracks. Number of rows returned in the result = 0 4. Find the tracks which cost less than a dollar but the track length (Milliseconds) is more than the average track length in this database. Print the name of such tracks. Number of rows returned in the result = 282 5. Find the playlists which have one or more tracks that have never been purchased. Print the Id, and the name of such playlists. Number of rows returned in the result = 14 6. Find the playlists where the composer is not specified for 10 or more tracks. Print the Id, and the name of such playlists. Number of rows returned in the result = 6 7. Find the playlists where all the tracks are by the same composer. Print the Id, and the name of such playlists. Number of rows returned in the result = 1 (4 is acceptable too) 8. Find the playlists with 50 or more composers. Print the Id, and the name of such playlists. Tracks with no composer (null) should not be considered. Number of rows returned in the result = 4 9. Find all the customers who have invoice total greater than 5.65. Print the first and last name, postal code, and invoice total for such customers. Number of rows returned in the result = 179 10. Find all the Employees to whom no other employee reports to. Print the Id, and the first and last name of such employees. Number of rows returned in the result = 5

Artist ArtistId Name Playlist Name Employee Employee Id LastName First Name Titl Reports To rthDate Hire Date Address State Country Postal Code Phone Fax: Emai Album AlbumId Title ArtistId L Playlist Track GA TrackId L customer CustomerId First Name LastName Company Address State Country PostalCode Phon Fax: Emai SupportRepld r Track TrackId Name Album Id MediaTypeld Genreld Composer seconds Bytes UnitPrice InvoiceLine InvoiceLineld Invoice Id TrackId UnitPrice Quantity Invoice Invoice Id Customer Id InvoiceDate BillingAddress BillingCity Billingstate BillingCountry BillingPostalCode Total MediaType CA MediaTypeld Name L Genre Genreld Name

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!