Lab 7: Primer into relational databases

In this lab you will learn to

  • Run a mysql container
  • Run SQL commands against your mysql database

Please do the following:

  1. Go through the lecture slides to set up your mysql container and create your links table
  2. Write an Insert Statement that inserts 10 more links to the database and run it
  3. Write an Update statement that increments the hit_count of the link with short_code “qwelmw” and run it
  4. Write an Update statement that changes the short_code of “http://www.twitter.com” to “wedfs” and run it

To test your work, run the query:

Select * from links

And determine if you have:

  1. 12 links in the table
  2. The hit_count of “http://www.google.com” is 3
  3. The short_code of “http://www.twitter.com” is “wedfs”