HW9-DB

Table of Contents

1 HW9 - Databases   slide

  • Use MySQL
  • Deliverable: file with queries and answer
  • SELECT INSERT UPDATE
  • Show your queries

2 Connecting   slide

  • mysql -u i253 -p i253
  • Password: check Piazza
  • show create table links

3 Queries   slide

  1. SELECT
    1. How many links were added afer 2014-10-14?
    2. How many links that were added before 2014-10-14 have fewer than 40 hits?
  2. INSERT
    1. Insert your own URL with a date before 2014-10-14 with greater than 40 hits.
    2. Is it possible that someone querying the database at the same time could see your insert partially complete (eg. only see some fields filled in)? What database property is this related to?
  3. UPDATE
    1. Increment the hit_count for only your new row. What is the new count?

4 MySQL Documentation   slide

  • Lots of options
  • OK to ask for help, but ask in general terms
  • "How can I combine constraints?"
  • Not "How can I search before X and fewer Y?"

Author: Jim Blomo

Created: 2014-10-31 Fri 21:32

Emacs 23.4.1 (Org mode 8.2.4)

Validate