Skip to content

Nando Theeßen#71

Open
NandoTheessen wants to merge 4 commits intobloominstituteoftechnology:masterfrom
NandoTheessen:master
Open

Nando Theeßen#71
NandoTheessen wants to merge 4 commits intobloominstituteoftechnology:masterfrom
NandoTheessen:master

Conversation

@NandoTheessen
Copy link
Copy Markdown

@NandoTheessen NandoTheessen commented Sep 4, 2018

Exercises, Day 1

  • Create a table called track that holds information about a music track. It should contain:
  • Create a table called artist_album
  • Run the queries in the file setup.sql. This will populate the tables.

Write Queries to:

  • Show all albums.
  • Show all albums made between 1975 and 1990.
  • Show all albums whose names start with Super D.
  • Show all albums that have no release year.
  • Write SQL SELECT queries that:
  • Show all track titles from Super Funky Album.
  • Same query as above, but rename the column from title to Track_Title in the 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 Ewoks were 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.
  • Figure out what happens when you try to delete an author with an existing note?
    How can you prevent this? (answered in README line 137+138)
  • Submit a file notes.sql with the queries that build (CREATE TABLE/INSERT) and query the database as noted above.

- Added day2.db & notes.sql
- included db creation queries
- included data insertion queries
- included search queries
- included delete query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant