Chapter3 - TheRelationalModel Chapter3

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

View Full Document Right Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 1 The Relational Model Chapter 3
Background image of page 1

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

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

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

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 4 Example Instance of Students Relation sid  name  login  age  gpa  53666  Jones  jones@cs  18  3.4  53688  Smith  smith@eecs  18  3.2  53650  Smith  smith@math  19  3.8   Cardinality = 3, degree = 5, all rows distinct  Do all columns in a relation instance have to     be distinct?
Background image of page 4
Database Management Systems, R. Ramakrishnan and J. Gehrke 5 Relational Query Languages A major strength of the relational model: supports  simple, powerful  querying  of data.  Queries can be written intuitively, and the DBMS  is responsible for efficient evaluation. – The key: precise semantics for relational queries. – Allows the optimizer to extensively re-order operations,  and still ensure that the answer does not change.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 6 The SQL Query Language Developed by IBM (system R) in the 1970s Need for a standard since it is used by many  vendors Standards:  – SQL-86 – SQL-89 (minor revision) – SQL-92 (major revision, current standard) – SQL-99 (major extensions)
Background image of page 6
Database Management Systems, R. Ramakrishnan and J. Gehrke 7 The SQL Query Language To find all 18 year old students, we can write: SELECT   * FROM   Students S WHERE   S.age=18 •To find just names and logins, replace the first line: SELECT   S.name, S.login sid name login age gpa 53666 Jones jones@cs 18 3.4 53688 Smith smith@ee 18 3.2
Background image of page 7

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

View Full DocumentRight Arrow Icon
Database Management Systems, R. Ramakrishnan and J. Gehrke 8  Querying Multiple Relations What does the following query compute?
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/06/2010 for the course CS COP 6371 taught by Professor Dr.hua during the Spring '10 term at University of Central Florida.

Page1 / 40

Chapter3 - TheRelationalModel Chapter3

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

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