SQL: Week 2 April 4 2011


Basic SQL

  • insert, update, delete

Working with Database Structures

  • creating tables
  • table columns
  • Keys & Indexes
  • Auto_Increment
  • Altering Structures

Assignment – Due April 10

  1. Read about Inner Joins
  2. Complete reading and examples in Chapter 5 – pages 162-176 – Basic SQL
  3. Read & examples in Chapter 6 – pages 179-222 – Database Structures
    Use the Workbench Scratchpad for the examples.   Also use the Create/Alter table interface in MySQL Workbench where appropriate in chapter 6.
  4. Project 1: The music database needs to be able to track the LABEL that releases every album.   Add a table to the database and insert several rows – such as:
    Motown  |   Detroit   |   MI
    EMI  |  London  | UK
    Capitol Records | Los Angeles  | CA
    The table should have a primary key and a foreign key relationship to the album table.  Make the appropriate changes to the album table structure and data to include label information for every album.
    Send me an email including:
    a) any sql statement you used to create or alter the database tables.
    b) a listing of the albums in your record collection sorted by label.
  5. Quiz 1

2 comments for “SQL: Week 2 April 4 2011

  1. Pla
    April 11, 2011 at 5:58 pm

    Chapter 6 is about creating Databases. Do we download our own MySQL locally on our computer and create databases since we do not have permission to create database on the school’s DB?

    • April 11, 2011 at 6:56 pm

      Only the first 2 pages or so are about creating databases, which as Pla says we do not have the permission to do on the SRJC server. You should read but do not have to set up a new MySQL install just to run those two commands. The exercises in the remainder of the chapter can be run in the context of your single SRJC database.

Leave a Reply