Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.

Slides:



Advertisements
Similar presentations
The Relational Database Model – some relations you might want to avoid!!!
Advertisements

The Relational Database Model
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Relations The Relational Data Model John Sieg, UMass Lowell.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Basic (Flat) Relational Model.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield.
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.
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
Database Constraints. Database constraints are restrictions on the contents of the database or on database operations Database constraints provide a way.
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)
Database Systems Lecture # 8 11 th Feb,2011. The Relational Model of Data The term relation is basically just a mathematical term for a table. DBMS products.
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.
Module Title? DBMS E-R Model to Relational Model.
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
Content Resource- Elamsari and Navathe, Fundamentals of Database Management systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 3 The Relational Data Model and Relational Database Constraints.
Learningcomputer.com SQL Server 2008 – Entity Relationships in a Database.
CG084&085 / / 1 The Relational Data Model Properties of Relations Keys and Constraints.
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.
Module 3: The Relational Model.  Overview Terminology Relational Data Structure Mathematical Relations Database Relations Relational Keys Relational.
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.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
Data Integrity An empty database is a correct database.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
Module Coordinator Tan Szu Tak School of Information and Communication Technology, Politeknik Brunei Semester
11/07/2003Akbar Mokhtarani (LBNL)1 Normalization of Relational Tables Akbar Mokhtarani LBNL (HENPC group) November 7, 2003.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Concepts 2440: 180 Database Concepts Instructor:
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 3 The Relational Database Model.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 3 The Relational Database Model.
1 CS 430 Database Theory Winter 2005 Lecture 4: Relational Model.
CSE314 Database Systems Lecture 3 The Relational Data Model and Relational Database Constraints Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
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 Systems Logical Data Modelling Tutor:Ian Perry Tel: Web:
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 3 The Relational Database Model. Database Systems, 10th Edition 2 * Relational model * View data logically rather than physically * Table * Structural.
CHAPTER 2 : RELATIONAL DATA MODEL Prepared by : nbs.
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.
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
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
Chapter 4 The Relational Model Pearson Education © 2009.
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.
Lecture 2 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.
The Relational Model Transparencies
Chapter 4 The Relational Model Pearson Education © 2009.
Chapter 4 The Relational Model Pearson Education © 2009.
Database Design: Relational Model
Design tools and techniques for a relational database system
Chapter 4 The Relational Model Pearson Education © 2009.
Presentation transcript:

Fundamentals of Relational Database Yong Choi School of Business CSUB, Bakersfield

Study Objectives Understand the relational database model’s basic components are entities and their attributes, and relationships among entities Identify how entities and their attributes are organized into tables Understand concept of integrity rules of relational database

Relational Model In the relational data model the database is represented as a group of related tables. The relational data model was introduced in 1970 by E. F. Codd of IBM published a paper in CACM entitled "A Relational Model of Data for Large Shared Data Banks". It is currently the most popular model. The mathematical simplicity and ease of visualization of the relational data model have contributed to its success.

Definitions of Terminology Formal relational termInformal equivalents relationtable tuplerow or record cardinalitynumber of rows attributecolumn or field degreenumber of columns (unique) identifierPrimary key domainpool of legal values

Characteristics of a Relation (table) Two-dimensional structure with rows and columns A relation represent a single entity Each table must have an attribute to uniquely identify each row Column values all have same data type Order of the rows and columns is immaterial to the DBMS

Properties of a Relation Based on the set theory 1. There are no duplicate tuples (rows). The body of the relation is a mathematical set (i.e., a set of tuples), and sets in mathematics by definition do not include duplicate elements. If a "relation" contains duplicate tuples, then it is not a relation.

Properties of a Relation 2. Tuples (rows) are unordered (top to bottom). Sets in mathematics are not ordered. So, even if a relation A's tuples are reversely ordered, it is still the same relation. Thus, there is no such thing as "the 5th tuple" or the last tuple. In other words, there is no concept of positional addressing.

Properties of a Relation 3. Attributes (columns) are unordered (left to right). The heading of a relation is also defined as a set. There is no such thing as "5th attribute (column)" or the last attribute.

Properties of a Relation 4. All attribute values are atomic. At every row-and-column position within the table, there always exists precisely one value, never a list of values. Or equivalently, relations do not contain repeating groups. A relation satisfying this condition is said to be in First Normal Form.

Primary Key A PK is an attribute, or collection of attributes, whose values uniquely identify each tuple in a relation. To being unique, a PK must be minimal (contain no unnecessary attributes) and must not change in value.

Primary Key (con’t) One attribute, or collection of attributes, that can serve as a PK is called candidate key, And the remaining keys that cannot be used as a PK are called alternate key. Cost of PK SS# vs. finger print

Candidate Key and Alternate key Could any attribute (column) serve as the PK? candidate key Is there any attribute that should not be served as the PK? alternate key StateAbbrevStateNameStateNumberStateBirdStatePopulation CTConnecticut5American Robin3,287, MIMichigan26Robin9,295, SDSouth Dakota40Phesant696, TNTennessee16Mockingbird4,877, TXTexas28Mockingbird16,986, State

Entity Integrity Rule Guarantees that each entity will have a unique identity and ensures that foreign key values can properly reference primary key values. Requirement No component of the primary key is allowed to accept nulls. By "null" here, we mean that information is missing for some reason.

Foreign Key An attribute in one table whose values must either match the primary key in another table or be null. Attribute FK of base relation R2 is a foreign key if and only if it satisfies the following two time-independent properties: Each value of FK is either wholly null or wholly non-null. Each non-null value of FK is identical to the value of PK in some tuple of R1.

Foreign Key (con’t)

Referential Integrity Rule The database must not contain any unmatched foreign key values. Just as primary key values represent entity identifiers, so foreign key values represent entity references. The referential integrity rule simply says that if B references A, then A must exist.

Referential Integrity Enforcement Restriction: does not allow any deletion Nullification: if value is deleted, reference value will set to be null. Cascading: if value is deleted, reference value will also be deleted. if value is updated, reference value will also be updated. Default value: if value is deleted, reference value will be have default value, which is provided by the system.

Access DB Referential Integrity Cascade Update Related Fields Change of PK values in primary table  automatic change of FK values Cascade Delete Related Fields Delete of a record in the primary table  automatic delete of all records in the related table that have a matching FK value