CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.

Slides:



Advertisements
Similar presentations
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Advertisements

Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
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.
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design.
CS 3630 Database Design and Implementation. First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema DBDL 2.
1 CS 3630 Database Design and Implementation. 2 Final Exam 7:00 – 8:52 PM, Thursday, May 16 Section 1: Ull 009 Section 2: Ull Points –50 points.
CS424 PK, FK, FD Normalization Primary and Foreign Keys Primary and foreign keys are the most basic components on which relational theory is based. Primary.
The Relational Model Codd (1970): based on set theory Relational model: represents the database as a collection of relations (a table of values --> file)
Thomas Connolly and Carolyn Begg’s
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Database Architecture The Relational Database Model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial Password: UWPstudent Password is case sensitive.
Chapter 3 Relational Model Chapter 4 in Textbook.
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
Relational Model & Relational Algebra. 2 Relational Model u Terminology of relational model. u How tables are used to represent data. u Connection between.
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.
Chapter 4 The Relational Model.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Chapters 17 & 18 Physical Database Design Methodology.
RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel.
Chapter 3 The Relational Model. 2 Chapter 3 - Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Relational Database. Database Management System (DBMS)
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Creating Tables and Inserting Records -- Not easy to edit! -- check constraints! Create table test1 ( C1 char(5) primary key, C2 Varchar2(15) not null.
CS 3630 Database Design and Implementation. Database Schema Branch (Bno…) Staff (Sno…Bno) Owner (Ono…) PropertyForRent (Pno…Ono) Renter (Rno…) Viewing.
12/2/2015CPSC , CPSC , Lecture 41 Relational Model.
CS 3630 Database Design and Implementation. Unnormalized Form (UNF) student courses John CS363 CS334 CS323 Multi-Value attribute Common in reports 2.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
The relational model A data model (in general) : Integrated collection of concepts for describing data (data requirements). Relational model was introduced.
Introduction to Database System. 1. Define Database, Database Management System and Database System. Explain the components of DBMS with its advantages.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
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,
Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
Chapter 3: Relational Databases
Lecture 03 Constraints. Example Schema CONSTRAINTS.
CS 3630 Database Design and Implementation. Base Table and View Base Table Stored on disk View Virtual table Records are not stored on disk Query is stored.
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
Mapping ER to Relational Model Each strong entity set becomes a table. Each weak entity set also becomes a table by adding primary key of owner entity.
Chapter 3 The Relational Model. Objectives u Terminology of relational model. u How tables are used to represent data. u Connection between mathematical.
Logical Database Design and Relation Data Model Muhammad Nasir
Chapter 4 The Relational Model Pearson Education © 2009.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Lecture # 14 Chapter # 5 The Relational Data Model and Relational Database Constraints Database Systems.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Constraints AND Examples
Chapter 3 The Relational Model.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
CS 3630 Database Design and Implementation
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Constraints AND Examples
Chapter 3 The Relational Model
Presentation transcript:

CS 3630 Database Design and Implementation

Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell Phone number BranchNo in Staff table if BranchNo is not required for all staff 2

RDBMS Relational DBMS should be able to handle NULL values. One issue Null = Null? List all staff who have not been assigned to a branch yet. BranchNo = Null -- Will not work BranchNo is null - This will work 3

Entity Integrity In a base relation, no attribute of the primary key can be NULL. Candidate Key: Minimum set of attributes to uniquely identify records. Primary Key: The selected candidate key 4

Referential Integrity Foreign key Must match a primary key in the parent relation Or Wholly NULL For any table instance! 5

FK of Staff: Bno references Branch Which branch is SG100 in? Which branch is SG363 in? Which branch is SA200 in? Foreign key Must match a primary key in the parent relation, or Wholly NULL SG363 is OK: has not been signed to a branch yet Branch BnoPhone… B101 B205 Staff SnoPhoneBno SG100B101 SG363Null SA200B000 6

FK of Booking: (HotelNo, RoomNo) Which hotel is booking 001 for? Which room is booking 002 for? Foreign key Must match a primary key in the parent relation, or (Wholly NULL) Room HotelnoRoomNo… H101R001 H101R009 H109R001 Booking HotelNoRoomNoBookingNoGuestNo NullR G100 H101Null 002G200 H101R G200 7

Enterprise Constraints Business rules need to be enforced in database Functional Dependency Domain for each attribute HotelRoom (HotelNo, RoomNo…Type…) Type is a string, but three possible values: Family, Double, Single Stored Procedures Trigger 8

Relational Integrity Entity Integrity PK Referential Integrity FK Enterprise Constraints More rules 9

Schedule Today Assignment6-1 Friday Quiz2 Assignment6-2 Wednesday, March 11 Test1 10

Quiz 2 (25 points) Friday, March 6 Lab 206 Using Computers D2L: download and upload file Derive table schemas from E-R Model (Mapping E-R Model to Database Schema) DBDL Functional Dependency Note11 – Note14 Assignment 4, 5-1 and

Assignment5-2 12