Homework 1

Chapters 1, 2, and 3
Work on the following questions:
  1. Write SQL Queries
    Instructions:
    1. Log in the Linux server. Copy the script from the share directory to create a table called cellar on your database from Linux shell command window.
      cp /shared/csc6341/cellar.sql .
      mysql JDOE -u jdoe -p < cellar.sql
    2. Log in MySQL database
      mysql JDOE -u jdoe -p
    3. Run the follow SQL queries (or commands).
      select database();
      select user();
      select now();
      show tables;
    4. Write and run SQL queries to answer the folloting questions on the textbook.
      • 1.8 (a) Get bin number, name of wine, and number of bottles for all Geyser Peak wines.
      • 1.8 (b) Get bin number and name of wine for all wines for which there are more than five bottles in stock.
      • 1.8 (d) Add three bottles to bin number 30. (hint: set bottles = bottles + 30)
      • 1.8 (e) Remove all Chardonnay from stock.
      • 1.8 (f) Add an entry for a new case (12 bottles) of Gary Farrell Merlot: bin number 55, year 2000, ready in 2005.
      Submit your SQL queries and results returned from the mySQL database
  2. (2.4) List the major functions performed by the DBMS.
  3. (2.7) List the major functions performed by the DBA
Submit your work to Canvas