CS145 Lecture Notes (1) -- Introductory Material


This lecture material complements the assigned readings: Chapter 1 of the textbook, and the Introduction to "SQL for Web Nerds" by Philip Greenspun (linked from the Course Schedule). Please do the readings.

Database Management System (DBMS):
Provides efficient, convenient, and safe multi-user storage of and access to massive amounts of persistent data

Most familiar use: many Web sites rely heavily on DBMS's. (And you will build one!)

Examples: (solicit from class)






Non-Web examples of DBMS's: (solicit from class)





Example: Online Bookseller

Data = information on books (including categories, bestsellers, etc.), customers, pending orders, order histories, trends and preferences, etc.


Multi-user example and discussion:

Jane and John both have ID number for bookseller gift certificate (credit) of $200 they got as a wedding gift.

Jane @ her office: orders "Database Systems: The Complete Book" ($95)

  prompt user for credit ID;
  get credit from database;
  if credit >= 95 then
      credit := credit - 95;
      issue order to mail book;
      if OK then put new credit into database (else handle error);
  else print "sorry"
John @ his office: orders "A First Course in Database Systems" ($75)
  prompt user for credit ID;
  get credit from database;
  if credit >= 75 then
      credit := credit - 75;
      issue order to mail book;
      if OK then put new credit into database (else handle error);
  else print "sorry"
Initial credit = $200
Ending credit = ???

  • Appears similar to concurrent programming problems (synchronization, semaphores, etc.)
    BUT: data not main-memory variables

  • Appears similar to file system concurrent access
    BUT: want to control at smaller granularity

  • Also database may be distributed, replicated, etc.



    A DBMS is a Software System

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    Major DBMS Products and Freeware

    (Fewer vendors every year...)
  • All are "relational" (or "object-relational") database systems at their core.

  • All commercial vendors also provide XML support, either built-in or built-on-top.


    Terminology and Basic Ideas

    Data model

    Schema versus data

    Data Definition Language (DDL)

    Data Manipulation Language (DML)

    People


    Less Traditional Database Applications

    Towards the end of the course we will learn about systems being developed to address many of these applications.