CSC 280: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS Dr. Adam Anthony Fall 2012.

Slides:



Advertisements
Similar presentations
The Relational Model Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Advertisements

Chapter 3 : Relational Model
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
Relational Model Stores data as tables –Each column contains values about the same attribute –Each column has a distinct name –Each row contains values.
Database Architecture The Relational Database Model.
Chapter 5 Relational Model Concepts Dr. Bernard Chen Ph.D. University of Central Arkansas.
CS 380 Introduction to Database Systems (Chapter 5: The Relational Data Model and Relational Database Constraints)
1 Relational model concepts Key constraints Referential integrity constraint Steen Jensen, autumn 2013.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model Pearson Education © 2014.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Relational Model Session 6 Course Name: Database System Year : 2012.
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Relational Data Model. A Brief History of Data Models  1950s file systems, punched cards  1960s hierarchical  IMS  1970s network  CODASYL, IDMS 
FEN  Concepts and terminology  Operations (relational algebra)  Integrity constraints The relational model.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
Instructor: Churee Techawut Basic Concepts of Relational Database Chapter 5 CS (204)321 Database System I.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 5 The Relational Data Model.
The Relational Data Model and Relational Database Constraints
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
R ELATIONAL D ATA M ODEL Joe Meehean 1. R ELATIONAL D ATA M ODEL Data stored as a set of relations really just tables Tables related to one another through.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 2 Adapted from Silberschatz, et al. CHECK SLIDE 16.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez Martínez Electrical and Computer Engineering Department Lecture 2 – Relational Model.
Copyright © Curt Hill The Relational Model of Database Basic organization and terms.
Databases. Not All Tables Are Created Equal Spreadsheets use tables to store data and formulas associated with that data The “meaning” of data is implicit.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com ICOM 5016 – Introduction.
FEN Introduction to the database field:  The Relational Model Seminar: Introduction to relational databases.
Module Coordinator Tan Szu Tak School of Information and Communication Technology, Politeknik Brunei Semester
CSc340 1b1 The Relational Model Chapter 2 Database Schema Keys Schema Diagrams Relational Query Languages Relational Operations.
Database Systems, 9th Edition 1.  In this chapter, students will learn: That the relational database model offers a logical view of data About the relational.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Announcements Reading for Monday –4.6 Homework 3 – Due 9/29.
Chapter 2 Introduction to Relational Model. Example of a Relation attributes (or columns) tuples (or rows) Introduction to Relational Model 2.
Chapter 2: Intro to Relational Model. 2.2 Example of a Relation attributes (or columns) tuples (or rows)
12/2/2015CPSC , CPSC , Lecture 41 Relational Model.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Introduction.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
Lecture 03 Constraints. Example Schema CONSTRAINTS.
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
The relational model1 The relational model Mathematical basis for relational databases.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Quiz Which of the following is not a mandatory characteristic of a relation? Rows are not ordered (Not required) Each row is a unique There is a.
Lecture 5 Data Model Design Jeffery S. Horsburgh Hydroinformatics Fall 2012 This work was funded by National Science Foundation Grant EPS
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 2: Intro to Relational.
Module 2: Intro to Relational Model
Databases Chapter 16.
Introduction to Relational Model
Chapter 2: Relational Model
RELATION.
Chapter 2: Intro to Relational Model
Chapter 3: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
Example of a Relation attributes (or columns) tuples (or rows)
Chapter 2: Intro to Relational Model
Chapter 2: Intro to Relational Model
INSTRUCTOR: MRS T.G. ZHOU
Presentation transcript:

CSC 280: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS Dr. Adam Anthony Fall 2012

Lecture 2  Introduction to the Relational Model  Views of Data  Definition of a Relation  Schemas and Keys

Different Views of Data  Disk (physical) level:  Where does each bit go on the drive, and how do we retrieve it when we need it?  Logical level:  What is the picture in our head of how the data is arranged?  May or may not differ from reality of the disk level  View level:  That portion of the logical level that we can see  Sometimes a refined version of the logical level

What is a Relation?  UNLEARN: In a database context, a relation is NOT a link between two different entities (e.g. a family tree relation)  Though we can represent such data  RE-LEARN: A relation is actually a theoretical collection of potential entities with common attributes  Imagine the data to describe a single instructor  Imagine a relation for instructor as being a data table, but you don’t know what instructors are listed in that table yet Any instructor who ever exists MIGHT be in the table

A Relation Instance  Given a Relational Definition:  Instructor(ID, name, dept_name, salary)  We create a data file with actual data:  IMPORTANT: OPERATIONS DEFINED ON RELATIONS WILL BE INDEPENDENT OF ANY ACTUAL DATA

In-Class Exercise  Same groups as last time:  Use the relation schema definition format: relation-name(attribute1,attribute2,…) To define at least three relations you might see in a music database

Terminology  Relation: a data table with defined column types  Tuple: a single row in a relation table  Attribute: a single column in a relation or tuple  Relation Instance: a data table with specific data entries already in it  Order-Independent: the rows in a relation are not ordered; if the tuples are the same but in different order, the relations are equal.  Domain: indicates the kind of values allowed for an attribute (integer range, characters, date/time, etc)  Should be atomic, or, single-valued

Keys  Let K  R  K is a superkey of R if values for K are sufficient to identify a unique tuple of each possible relation r(R)  Example: {ID} and {ID,name} are both superkeys of instructor.  Superkey K is a candidate key if K is minimal Example: {ID} is a candidate key for Instructor  One of the candidate keys is selected to be the primary key.  which one?

Find the Keys  Determine good primary keys for part of the university schema (underline your choice):  Instructor(ID,name,dept_name,salary)  Department(dept_name,building,budget)  Student(ID,name,dept_name,tot_cred)  Advisor(s_id,i_id)  Takes(ID,course_id,sec_id,semester,year,grade)  Classroom(building,room_number,capacity)  Time_slot(time_slot_id,day,start_time,end_time)

Foreign Keys  Foreign key constraint: Value in one relation must appear in another  Referencing relation  Referenced relation

Textbook University Schema Diagram

In-Class Activity  Draw a schema diagram for the music database from earlier. Underline primary keys, and use arrows for foreign keys.