lec03 - The Relational Model Chapter 3 1/6/11 EECS 484:...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 0 The Relational Model Chapter 3 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 1 Relational Databases Most common data model in modern DMBSs Many commercial systems Oracle, MS SQL Server, IBM DB2, more… Also open source MySQL, PostgreSQL, more…
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 2 Terminology Database : A set of relations Relation : Consists of two parts Instance : A table, with rows (aka tuples, records), and columns (aka fields, attributes) # Rows = cardinality # Columns = degree / arity Schema Relation name Name and domain (i.e., type) for each column E.g., Student (sid: integer, name: string, gpa: real) • Set semantics: (classical relational model) Every row in a relation is unique • Multiset semantics: (modern systems, SQL) Duplicate rows allowed 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 3 Instance of Athlete Relation Swimming USA Michael Phelps 3 Track USA Jackie Joyner-Kersee 2 Gymnastics USA Mary Lou Retton 1 Sport Country Name AID What is the schema? (aid: integer, name: string, country: string, sport:string) Cardinality = 3, Degree = 4
Background image of page 2
3 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 4 Relational Query Languages Supports simple access and analysis of data Queries written declaratively In contrast to procedural methods DBMS is responsible for efficient evaluation System can optimize for efficient query execution, and still ensure that the answer does not change 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 5 SQL: Structured Query Language Developed by IBM (system R) in the 1970s Need for a standard since it is used by many vendors SQL Standard (sort of) implemented by all major DBMS vendors Beyond the basics, you’ll notice some differences between systems…
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 6 Creating Relations in SQL Create the Athlete relation Domain constraint (type) enforced when tuples added or modified Create the Olympics relation Create the Compete relation CREATE TABLE Athlete ( aid INTEGER, name CHAR(30), country CHAR(20), sport CHAR(20)) CREATE TABLE Olympics ( oid INTEGER, year INTEGER, city CHAR(20)) CREATE TABLE Compete ( aid INTEGER, oid INTEGER) 1/6/11 EECS 484: Database Management Systems, Kristen LeFevre 7 Quick Review This looks familiar… What are the entity
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2011 for the course EECS 484 taught by Professor Staff during the Winter '08 term at University of Michigan.

Page1 / 13

lec03 - The Relational Model Chapter 3 1/6/11 EECS 484:...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online