Wladimir Fraga CS10#68
Open
wladimir917 wants to merge 8 commits intobloominstituteoftechnology:masterfrom
Open
Wladimir Fraga CS10#68wladimir917 wants to merge 8 commits intobloominstituteoftechnology:masterfrom
wladimir917 wants to merge 8 commits intobloominstituteoftechnology:masterfrom
Conversation
|
Your query for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create a Music Database
Exercises, Day 1
Before you begin, look at the queries in
setup.sqlto get a hint as to thecolumn names in the following tables. We'll use
setup.sqllater.* Create a table called
trackthat holds information about a music track. It should contain:idVARCHAR, probably)idin tablealbum(the album the track is on). Thisshould be a foreign key.
* Create a table called
artist_albumto connect artists to albums. (Note thatan artist might have several albums and an album might be created by multiple
artists.)
* Run the queries in the file
setup.sql. This will populate the tables.DROP TABLEcan be used to delete a table so you can recreate it withCREATE TABLE.* Write SQL
SELECTqueries that:Super D.* Write SQL
SELECTqueries that:Show all track titles from
Super Funky Album.Same query as above, but rename the column from
titletoTrack_Titleinthe output.
Select all album titles by
Han Solo.Select the average year all albums were released.
Select the average year all albums by
Leia and the Ewokswere released.Select the number of artists.
Select the number of tracks on
Super Dubstep Album.Exercises, Day 2
Create a database for taking notes.
What are the columns that a note table needs?
If you have a timestamp field, how do you auto-populate it with the date?
A note should have a foreign key pointing to an author in an author table.
What columns are needed for the author table?
Write queries that:
Insert authors to the author table.
Insert notes to the note table.
Select all notes by an author's name.
Select author for a particular note by note ID.
Select the names of all the authors along with the number of notes they each have. (Hint:
GROUP BY.)Delete authors from the author table.
Submit a file
notes.sqlwith the queries that build (CREATE TABLE/INSERT)and query the database as noted above.