CS 157B Database Systems Dr. T Y Lin. Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Chapter 10: Designing Databases
Relational Database. Relational database: a set of relations Relation: made up of 2 parts: − Schema : specifies the name of relations, plus name and type.
Chapter 3 : Relational Model
Chapter 3 Notes. 3.1 Functional Dependencies A functional dependency is a statement that – two tuples of a relation that agree on some particular set.
Relational Normalization Theory. Limitations of E-R Designs Provides a set of guidelines, does not result in a unique database schema Does not provide.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 6 A First Course in Database Systems.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 227 Database Systems I Design Theory for Relational Databases.
Instructor: Amol Deshpande  Data Models ◦ Conceptual representation of the data  Data Retrieval ◦ How to ask questions of the database.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
SPRING 2004CENG 3521 The Relational Model Chapter 3.
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
1 Multi-valued Dependencies. 2 Multivalued Dependencies There are database schemas in BCNF that do not seem to be sufficiently normalized. Consider a.
CMSC424: Database Design Instructor: Amol Deshpande
CS405G: Introduction to Database Systems Final Review.
CMSC424: Database Design Instructor: Amol Deshpande
1 Relational Data Model CS 157B Nidhi Patel. 2 What is a Data Model? A notation for describing data or information A notation for describing data or information.
Relation Decomposition A, A, … A 12n Given a relation R with attributes Create two relations R1 and R2 with attributes B, B, … B 12m C, C, … C 12l Such.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Database Systems Chapter 1 The Worlds of Database Systems.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Computing & Information Sciences Kansas State University Wednesday, 01 Oct 2008CIS 560: Database System Concepts Lecture 15 of 42 Wednesday, 01 October.
Web-Enabled Decision Support Systems
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Concepts and Terminology Introduction to Database.
Relational Database Design by Relational Database Design by Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING.
Chapter 5 The Relational Model and Normalization David M. Kroenke Database Processing © 2000 Prentice Hall.
10/9/20151 The Relational Data Model TCU Database Systems Last update: September 2004 Reference: Elmasri 4 th edition, chapter 5.
NormalizationNormalization Chapter 4. Purpose of Normalization Normalization  A technique for producing a set of relations with desirable properties,
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall, Modified by Dr. Mathis 3-1 David M. Kroenke’s Chapter Three: The Relational.
Relational Algebra Spring 2012 Instructor: Hassan Khosravi.
1.1 CAS CS 460/660 Relational Model. 1.2 Review E/R Model: Entities, relationships, attributes Cardinalities: 1:1, 1:n, m:1, m:n Keys: superkeys, candidate.
Relational Data Model Ch. 7.1 – 7.3 John Ortiz Lecture 3Relational Data Model2 Why Study Relational Model?  Most widely used model.  Vendors: IBM,
CSE314 Database Systems Basics of Functional Dependencies and Normalization for Relational Databases Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E.
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
The Relational Model 01/28/2014 – Material from Chapter 4 (Chap2 and Chap3 make an appearance)
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
1 Functional Dependencies and Normalization Chapter 15.
© D. Wong Ch. 3 (continued)  Database design problems  Functional Dependency  Keys of relations  Decompositions based on Functional Dependency.
Referential Integrity checks, Triggers and Assertions Examples from Chapter 7 of Database Systems: the Complete Book Garcia-Molina, Ullman, & Widom.
© D. Wong Normalization  Purpose: process to eliminate redundancy in relations due to functional or multi-valued dependencies.  Decompose relation.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 4 Introduction to a First Course in Database Systems.
Dr. T. Y. Lin | SJSU | CS 157A | Fall 2011 Chapter 2 THE RELATIONAL MODEL OF DATA 1.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
SQL Exercises – Part I April
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
The Relational Model of Data Prof. Yin-Fu Huang CSIE, NYUST Chapter 2.
CS 157B Database Systems Dr. T Y Lin. 1.2 Overview of a Database Management System Data-Definition Language Commands –Illustrated by three examples.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Logical Database Design and Relational Data Model Muhammad Nasir
© D. Wong Ch. 3 (part 1)  Relational Model basics  From E/R diagram to Relations.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
Modeling: Entity-Relationship Diagrams
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
Relational Database Design by ER- and EER-to- Relational Mapping
THE RELATIONAL MODEL OF DATA
Quiz Questions Q.1 An entity set that does not have sufficient attributes to form a primary key is a (A) strong entity set. (B) weak entity set. (C) simple.
Relational Database Design by Dr. S. Sridhar, Ph. D
3.1 Functional Dependencies
Translation of ER-diagram into Relational Schema
From ER to Relational Model
CS405G: Introduction to Database Systems
Functional Dependencies and Normalization
The Relational Model Textbook /7/2018.
02 - The Relational Database Model
Chapter 3: Multivalued Dependencies
Presentation transcript:

CS 157B Database Systems Dr. T Y Lin

Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz category grade” 3.Upload DB3(Section 2.2.8),DB2, DB3 (will explain in class) into Oracle 4.Home work Exercise and Exercise a), pp 28-29

1.1 The Evolution of Database Systems Early Database Management Systems –Banking Systems –Airline Reservation Systems –Corporate Record Keeping Systems

1.1 The Evolution of Database Systems Relational Database Systems –Illustrated by Examples

1.1 The Evolution of Database Systems Smaller and Smaller Systems Bigger and Bigger Systems Information Integration –Data Warehouse

1.1.2 Relational Database Systems See word files three examples

Relational Data Model Key Notions Attributes: Name of the Columns Schemas: The name of the relation and the set of attributes Tuples: The rows of the relation other than the header row Domains: the past/present/future data

Relational Data Model Key Notions Primary key: Unique value Relation Instances: A relation about suppliers(DB1) and movies (DB3) are not static; relations change over times

1.2 Overview of a Database Management System Data-Definition Language Commands –Illustrated by three examples on the website

1.2 Overview of a Database Management System Overview of Query Processing Storage and Buffer Management Transaction Processing The Query Processor

1.3 Outline of Database-System Studies Relational Database Modeling Relational Database Programming Semi structured Data Modeling and Programming Database System Implementation Modern Database System Issues

2.1 An Overview of Data Models What is a Data Model? Important Data Models The Relational Model in Brief The Semistructured Model in Brief Other Data Models Comparison of Modeling Approaches

2.1.1 What is a Data Model? Real World  (Math model:) 1.Structure of the Data 2.Operations on the Data 3.Constraints on the Data

1.3 Outline of Database-System Studies

1.4 References for Chapter 1

Chapter 2 Relational Database Modeling

Delete this slide The Relational Model of Data Attributes: Name of the Columns Schemas: The name of the relation and the set of attributes Tuples: The rows of the relation other than the header row

Delete this slide Relational Data Model Key Notions Attributes: Name of the Columns Schemas: The name of the relation and the set of attributes Tuples: The rows of the relation other than the header row Domains: the past/present/future data

Delete this slide Relational Data Model Key Notions Relation Instances: A relation about suppliers(DB1) is not static; relations change over times Primary key: Unique value

2.1 An Overview of Data Models What is a Data Model? Important Data Models The Relational Model in Brief The Semistructured Model in Brief Other Data Models Comparison of Modeling Approaches

2.1.1 What is a Data Model? Real World  (Math model:) 1.Structure of the Data 2.Operations on the Data 3.Constraints on the Data

2.1.2 Important Data Models The Relational Model in Brief See Previous Examples The Semistructured Model in Brief Other Data Models Comparison of Modeling Approaches

2.2 Basics of the Relational Model Attributes Schemas Tuples Domains 2.2.5

2.2 Basics of the Relational Model TitleYearLengthgenre Gone with the wind Drama Star Wars SciFi Wayne’s world199295comedy Figure 2.3 The Relation Movies

2.2 Basics of the Relational Model Equivalent Representations of a Relation Relation Instances Keys of Relations An Example Database Schema See the three examples

2.2.5 Equivalent Representations of a Relation A relation is a subset (of Cartesian product of Domains), so there is no order among tuples (elements) Every attribute is named, so if data(element) move with names, there is no order; we often say the such data attribute value pair.

2.2.5 Equivalent Representations of a Relation YearGenreTitlelength 1977SciFiStar Wars ComedyWayne’s World DramaGone With the Wind231 Figure 2.4 Another presentation of the relation Movies

2.2.6 Relation Instances All the relation examples given in the web site are Relation Instances Relation is a variable Relation instance is a value in the variable.

2.2.7 Keys of Relations Primary Key Secondary Key Alternative Key

Database Schema about Movies Moviestar ( name : string, address : string, gender : char, birthdate : date ) Movies( title: string; Year : integer, Length : integer, Genre : string, studioName : string, producerC# : integer )

StarsIn ( MovieTitle: string, Movieyear : integer Starname : string ) MovieExec ( name: string, address : string cert# : integer netWorth : integer ) Studio ( name: string, address : string pressC# : integer )

2.2.8 An Example Database Schema

Two relations of Banking database acctNoTypeBalance 12345Savings Checking Saving25 firstNameLastNameId noAccount RobbieBanks LennaHand LennaHand The relations accounts The relations customers Figure 2.6 Two relations of banking customers

2.2.9 Exercises for Section 2.2

2.2.8 An Example Database Schema See Three Examples

Two relations of Banking database acctNoTypeBalance 12345Savings Checking Saving25 firstNameLastNameId noAccount RobbieBanks LennaHand LennaHand The relations accounts The relations customers Figure 2.6 Two relations of banking customers

2.2.9 Exercises for Section 2.2

2.3 Defining a Relation Schema in SQL Relations in SQL Data Types Simple Table Declarations Modifying Relation Schemas Default Values Declaring Keys Exercises for Section 2.3

2.3.1 Relations in SQL

2.3.2 Data Types

2.3.3 Simple Table Declarations

2.3.4 Modifying Relation Schemas

2.3.5 Default Values

2.3.6 Declaring Keys

2.3.7 Exercises for Section 2.3

2.4 An Algebraic Query Language Why Do We Need a Special Query Language? What is an Algebra? Overview of Relational Algebra Set Operations on Relations Projection Selection Cartesian Product Natural Joins Theta-Joins Combining Operations to Form Queries Naming and Renaming Relationships Among Operations A Linear Notation for Algebraic Expressions Exercises for Section 2.4

2.4.1 Why Do We Need a Special Query Language?

2.4.2 What is an Algebra?

2.4.3 Overview of Relational Algebra

2.4.4 Set Operations on Relations

2.4.5 Projection

2.4.6 Selection

2.4.7 Cartesian Product

2.4.8 Natural Joins

2.4.9 Theta-Joins

Combining Operations to Form Queries

Naming and Renaming

Relationships Among Operations

A Linear Notation for Algebraic Expressions

Exercises for Section 2.4

2.5 Constraints on Relations Relational Algebra as a Constraint Language Referential Integrity Constraints Key Constraints Additional Constraint Examples Exercises for Section Summary of Chapter References for Chapter 2

2.5.1 Relational Algebra as a Constraint Language

2.5.2 Referential Integrity Constraints

2.5.3 Key Constraints

2.5.4 Additional Constraint Examples

2.5.5 Exercises for Section 2.5

2.6 Summary of Chapter 2

2.7 References for Chapter 2

Chapter 3 Design Theory for Relational Databases

3.1 Functional Dependencies Definition of Functional Dependency Keys of Relations Superkeys Exercises for Section 3.1

3.1.1 Definition of Functional Dependency

3.1.2 Keys of Relations

3.1.3 Superkeys

3.1.4 Exercises for Section 3.1

3.2 Rules About Functional Dependencies Reasoning About Functional Dependencies The Splitting/Combining Rule Trivial Functional Dependencies Computing the Closure of Attributes Why the Closure Algorithm Works The Transitive Rule Closing Sets of Functional Dependencies Projecting Functional Dependencies Exercises for Section 3.2

3.2.1 Reasoning About Functional Dependencies

3.2.2 The Splitting/Combining Rule

3.2.3 Trivial Functional Dependencies

3.2.4 Computing the Closure of Attributes

3.2.5 Why the Closure Algorithm Works

3.2.6 The Transitive Rule

3.2.7 Closing Sets of Functional Dependencies

3.2.8 Projecting Functional Dependencies

3.2.9 Exercises for Section 3.2

3.3 Design of Relational Database Schemas Anomalies Decomposing Relations Boyce-Codd Normal Form Decomposition into BCNF Exercises for Section 3.3

3.3.1 Anomalies

3.3.2 Decomposing Relations

3.3.3 Boyce-Codd Normal Form

3.3.4 Decomposition into BCNF

3.3.5 Exercises for Section 3.3

3.4 Decomposition: The Good, Bad, and Ugly Recovering Information from a Decomposition The Chase Test for Lossless Join Why the Chase Works Dependency Preservation Exercises for Section 3.4

3.4.1 Recovering Information from a Decomposition

3.4.2 The Chase Test for Lossless Join

3.4.3 Why the Chase Works

3.4.4 Dependency Preservation

3.4.5 Exercises for Section 3.4

3.5 Third Normal Form Definition of Third Normal Form The Synthesis Algorithm for 3NF Schemas Why the 3NF Synthesis Algorithm Works Exercises for Section 3.5

3.5.1 Definition of Third Normal Form

3.5.2 The Synthesis Algorithm for 3NF Schemas

3.5.3 Why the 3NF Synthesis Algorithm Works

3.5.4 Exercises for Section 3.5

3.6 Multivalued Dependencies Attribute Independence and Its Consequent Redundancy Definition of Multivalued Dependencies Reasoning About Multivalued Dependencies Fourth Normal Form Decomposition into Fourth Normal Form Relationships Among Normal Forms Exercises for Section 3.6

3.6.1 Attribute Independence and Its Consequent Redundancy

3.6.2 Definition of Multivalued Dependencies

3.6.3 Reasoning About Multivalued Dependencies

3.6.4 Fourth Normal Form

3.6.5 Decomposition into Fourth Normal Form

3.6.6 Relationships Among Normal Forms

3.6.7 Exercises for Section 3.6

3.7 An Algorithm for Discovering MVD's The Closure and the Chase Extending the Chase to MVD's Why the Chase Works for MVD's Projecting MVD's Exercises for Section Summary of Chapter References for Chapter 3

3.7.1 The Closure and the Chase

3.7.2 Extending the Chase to MVD's

3.7.3 Why the Chase Works for MVD's

3.7.4 Projecting MVD's

3.7.5 Exercises for Section 3.7

3.8 Summary of Chapter 3

3.9 References for Chapter 3

Chapter 4 High-Level Database Models

4.1 The Entity/Relationship Model Entity Sets Attributes Relationships Entity-Relationship Diagrams Instances of an E/R Diagram Multiplicity of Binary E/R Relationships Multiway Relationships Roles in Relationships Attributes on Relationships Converting Multiway Relationships to Binary Subclasses in the E/R Model Exercises for Section 4.1

4.1.1 Entity Sets

4.1.2 Attributes

4.1.3 Relationships

4.1.4 Entity-Relationship Diagrams

4.1.5 Instances of an E/R Diagram

4.1.6 Multiplicity of Binary E/R Relationships

4.1.7 Multiway Relationships

4.1.8 Roles in Relationships

4.1.9 Attributes on Relationships

Converting Multiway Relationships to Binary

Subclasses in the E/R Model

Exercises for Section 4.1

4.2 Design Principles Faithfulness Avoiding Redundancy Simplicity Counts Choosing the Right Relationships Picking the Right Kind of Element Exercises for Section 4.2

4.2.1 Faithfulness

4.2.2 Avoiding Redundancy

4.2.3 Simplicity Counts

4.2.4 Choosing the Right Relationships

4.2.5 Picking the Right Kind of Element

4.2.6 Exercises for Section 4.2

4.3 Constraints in the E/R Model Keys in the E/R Model Representing Keys in the E/R Model Referential Integrity Degree Constraints Exercises for Section 4.3

4.3.1 Keys in the E/R Model

4.3.2 Representing Keys in the E/R Model

4.3.3 Referential Integrity

4.3.4 Degree Constraints

4.3.5 Exercises for Section 4.3

4.4 Weak Entity Sets Causes of Weak Entity Sets Requirements for Weak Entity Sets Weak Entity Set Notation Exercises for Section 4.4

4.4.1 Causes of Weak Entity Sets

4.4.2 Requirements for Weak Entity Sets

4.4.3 Weak Entity Set Notation

4.4.4 Exercises for Section 4.4

4.5 From E/R Diagrams to Relational Designs From Entity Sets to Relations From E/R Relationships to Relations Combining Relations Handling Weak Entity Sets Exercises for Section 4.5

4.5.1 From Entity Sets to Relations

4.5.2 From E/R Relationships to Relations

4.5.3 Combining Relations

4.5.4 Handling Weak Entity Sets

4.5.5 Exercises for Section 4.5

4.6 Converting Subclass Structures to Relations E/R-Style Conversion An Object-Oriented Approach Using Null Values to Combine Relations Comparison of Approaches Exercises for Section 4.6

4.6.1 E/R-Style Conversion

4.6.2 An Object-Oriented Approach

4.6.3 Using Null Values to Combine Relations

4.6.4 Comparison of Approaches

4.6.5 Exercises for Section 4.6

4.7 Unified Modeling Language UML Classes Keys for UML classes Associations Self-Associations Association Classes Subclasses in UML Aggregations and Compositions Exercises for Section 4.7

4.7.1 UML Classes

4.7.2 Keys for UML classes

4.7.3 Associations

4.7.4 Self-Associations

4.7.5 Association Classes

4.7.6 Subclasses in UML

4.7.7 Aggregations and Compositions

4.7.8 Exercises for Section 4.7

4.8 From UML Diagrams to Relations UML-to-Relations Basics From UML Subclasses to Relations From Aggregations and Compositions to Relations The UML Analog of Weak Entity Sets Exercises for Section 4.8

4.8.1 UML-to-Relations Basics

4.8.2 From UML Subclasses to Relations

4.8.3 From Aggregations and Compositions to Relations

4.8.4 The UML Analog of Weak Entity Sets

4.8.5 Exercises for Section 4.8

4.9 Object Definition Language Class Declarations Attributes in ODL Relationships in ODL Inverse Relationships Multiplicity of Relationships Types in ODL Subclasses in ODL Declaring Keys in ODL Exercises for Section 4.9

4.9.1 Class Declarations

4.9.2 Attributes in ODL

4.9.3 Relationships in ODL

4.9.4 Inverse Relationships

4.9.5 Multiplicity of Relationships

4.9.6 Types in ODL

4.9.7 Subclasses in ODL

4.9.8 Declaring Keys in ODL

4.9.9 Exercises for Section 4.9

4.10 From ODL Designs to Relational Designs From ODL Classes to Relations Complex Attributes in Classes Representing Set-Valued Attributes Representing Other Type Constructors Representing ODL Relationships Exercises for Section Summary of Chapter References for Chapter 4

From ODL Classes to Relations

Complex Attributes in Classes

Representing Set-Valued Attributes

Representing Other Type Constructors

Representing ODL Relationships

Exercises for Section 4.10

4.11 Summary of Chapter 4

4.12 References for Chapter 4