√2011-08-26-RelModel

√2011-08-26-RelModel - The Relational Model...

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

View Full Document Right Arrow Icon
The Relational Model Database Management Systems, R. Ramakrishnan and J. Gehrke 1 Why Study the Relational Model? Y Most widely used model. Vendors: IBM, Microsoft, Oracle, Sybase, etc. Y “Legacy systems” in older models Database Management Systems, R. Ramakrishnan and J. Gehrke 2 E.G., IBM’s IMS Y Competitor in the early 90s: object-oriented model A synthesis: object-relational model X Oracle, DB2 Y XML Relational Database: Definitions Y Relational database : a set of relations Y Relation: made up of two parts: Schema :specifiesname of relation, plus name and type of each column Database Management Systems, R. Ramakrishnan and J. Gehrke 3 type of each column. X E.G. Students( sid : string, name : string, login : string, age : integer, gpa : real). Instance : a table , with rows and columns. #Rows = cardinality , #fields = degree / arity. Y Can think of a relation as a set of rows or tuples (i.e., all rows are distinct).
Background image of page 1

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

View Full Document Right Arrow Icon
Example Instance of Students Relation sid name login age gpa 53666 Jones [email protected] 18 3.4 53688 Smith [email protected] 18 3.2 Database Management Systems, R. Ramakrishnan and J. Gehrke 4 53650 Smith [email protected] 19 3.8 Y Cardinality = 3, degree = 5, all rows distinct Y Do all columns in a relation instance have to be distinct? Logical DB Design: ER to Relational Y Entity sets to tables. Database Management Systems, R. Ramakrishnan and J. Gehrke 5 CREATE TABLE Employees (ssn CHAR(11), name CHAR(20), lot INTEGER, PRIMARY KEY (ssn) ) Employees ssn name lot Example Instance ssn name lot Employees Database Management Systems, R. Ramakrishnan and J. Gehrke 6 0983763423 John 10 9384392483 Jane 10 3743923483 Jill 20
Background image of page 2
Integrity Constraints (ICs) Y IC: condition that must be true for any instance of the database –Doma in con s t ra in t s Database Management Systems, R. Ramakrishnan and J. Gehrke 7 –Key con s t ra in t s –Fo re ign key con s t ra in t ( la te r ) Y A legal
Background image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 11

√2011-08-26-RelModel - The Relational Model...

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

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