1. Homepage
  2. Programming
  3. Assignment 2: Part 1. SQL - Chinook Database

Assignment 2: Part 1. SQL - Chinook Database

Engage in a Conversation
CanadaCarleton UniversityDatabaseSQLChinook Database

Assignment 2: Part 1. SQL

Directions

  • pay attention to where your file is saved as you will need to upload it to Brightspace
  • fill in the appropriate command for each instruction statement
  • when completed, upload your .ipynb file to Brightspace.
  • refer to the chinook database schema below

image.png Please type your name here: Please type your student number here: CourseNana.COM

import sqlite3 as sql3
import pandas as pd
In [6]:
conn=sql3.connect('Chinook.db')  
  1. (3pts) Write an SQL query that returns all the Album titles that start with 'S'. In [ ]: CourseNana.COM

  2. (6 pts) Write an SQL query that returns all the Genres' names and the number of associated tracks (ie. count up the tracks for each Genre). Name the column that contains the count of genre tracks NumGenre. Order the results highest to lowest by NumGenre. In [ ]: CourseNana.COM

  3. (4 pts) Write an SQL query that returns all the Track Names and Composers for the Bossa Nova genre. In [ ]: CourseNana.COM

  4. (7 pts) Write an SQL query that returns Genre name and its associated number of tracks (ie. count up the tracks for each Genre) for the genres that have more than 300 tracks associated with it. Name the column that contains the count of genre tracks NumGenre. Order the results alphabetically by the Genre Name. In [ ]: CourseNana.COM

  5. (5 pts) Write an SQL query that returns the first name, last name, and Title of Employees and the first and last names of their associated Customers. Display all Employees whether or not they have Customers, except those with a Title of General Manager. Use the following aliases for the outputted columns: EmpFName, EmpLName, EmpTitle, CustFName, CustLName. Order the results by EmpLName and then by EmpFName. In [ ]: CourseNana.COM

  6. (5 pts) Write an SQL query that returns the number of invoices that customer Rojas has. Display the number of invoices in a column named NumInvoice. Ensure you display the Customer's last name as well. In [ ]: CourseNana.COM

  7. (9 pts) Write an SQL query that returns the InvoiceID, InvoiceDate, and Track Names for all of customer Rojas's invoices. Please include the customer's last name and order the results by the InvoiceDate from newest to oldest. In [ ]: CourseNana.COM

  8. (5 pts) Write an SQL query that lists out all the track names for the Classical playlist. Also return the Composer for each track. In [ ]: CourseNana.COM

  9. (8 pts) Write an SQL query that calculates the total price for all tracks in the Classical playlist. Display the name of playlist, the number of tracks and the playlist price. In [ ]: CourseNana.COM

  10. (6 pts) Write an SQL query that returns genre name, track name and media type name for all tracks that are in either the rock or pop genre. Sort your results by track genre name CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
Canada代写,Carleton University代写,Database代写,SQL代写,Chinook Database代写,Canada代编,Carleton University代编,Database代编,SQL代编,Chinook Database代编,Canada代考,Carleton University代考,Database代考,SQL代考,Chinook Database代考,Canadahelp,Carleton Universityhelp,Databasehelp,SQLhelp,Chinook Databasehelp,Canada作业代写,Carleton University作业代写,Database作业代写,SQL作业代写,Chinook Database作业代写,Canada编程代写,Carleton University编程代写,Database编程代写,SQL编程代写,Chinook Database编程代写,Canadaprogramming help,Carleton Universityprogramming help,Databaseprogramming help,SQLprogramming help,Chinook Databaseprogramming help,Canadaassignment help,Carleton Universityassignment help,Databaseassignment help,SQLassignment help,Chinook Databaseassignment help,Canadasolution,Carleton Universitysolution,Databasesolution,SQLsolution,Chinook Databasesolution,