Skip to content

Instantly share code, notes, and snippets.

@mdang
Last active February 16, 2018 16:14
Show Gist options
  • Save mdang/7e68c9473de0c0363d9b778d7ca02c2b to your computer and use it in GitHub Desktop.
Save mdang/7e68c9473de0c0363d9b778d7ca02c2b to your computer and use it in GitHub Desktop.
Exercise: SQL Practice

SQL Practice

15 min

Let's populate the wdi database with some data and get more practice with SQL.

Insert the following 4 students into the users table.

  • Jill's full name is Jilly Cakes; her favorite number is 22
  • Johns's full name is Johnny Bananas; his favorite number is 45221
  • Jackie's full name is Jackie Lackie; her favorite number is 3
  • Slagathorn's full name is Slaggy McRaggy; his favorite number is 11

Queries

  1. Do a count to verify how many records are in your database
  2. Update Johnny Bananas to have a favorite number of 17
  3. Update Slaggy McRaggy to have the last name of 'Raggy' instead
  4. View all the records and verify the data is correct
  5. Delete the last user in the database
  6. View all the records and make sure the last user is no longer there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment