Relational data model. Codd's Rule E.F Codd was a Computer Scientist who invented Relational model for Database management. Based on relational model,

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
CIT 613: Relational Database Development using SQL Introduction to SQL.
Relational Databases Chapter 4.
ETEC 100 Information Technology
The Relational Database Model:
The Relational Database Model. 2 Objectives How relational database model takes a logical view of data Understand how the relational model’s basic components.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
The Relational Database Model
Database Lecture # 1 By Ubaid Ullah.
© Pearson Education Limited, Chapter 2 The Relational Model Transparencies.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Database Technical Session By: Prof. Adarsh Patel.
MIS 301 Information Systems in Organizations Dave Salisbury ( )
CODD’s 12 RULES OF RELATIONAL DATABASE
Module 3: The Relational Model.  Overview Terminology Relational Data Structure Mathematical Relations Database Relations Relational Keys Relational.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
Slide Chapter 5 The Relational Data Model and Relational Database Constraints.
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.
D R. E.F.C ODD ’ S R ULES FOR RDBMS Dr. E.F.Codd is an IBM researcher who first developed the relational data model in 1970.Dr. Codd published a list.
Oracle 11g: SQL Chapter 4 Constraints.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
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.
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.
Session 1 Module 1: Introduction to Data Integrity
CIT 613: Relational Database Development using SQL Introduction to SQL DeSiaMorePowered by DeSiaMore 1.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 3 The Relational Database Model.
Logical Database Design and Relation Data Model Muhammad Nasir
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Data Integrity & Indexes / Session 1/ 1 of 37 Session 1 Module 1: Introduction to Data Integrity Module 2: Introduction to Indexes.
Getting started with Accurately Storing Data
Fundamentals of DBMS Notes-1.
Logical Database Design and the Rational Model
Understanding Data Storage
The Relational Database Model
Relational Database Management System
Chapter 6 - Database Implementation and Use
© 2014 by McGraw-Hill Education. This is proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Information Systems Today: Managing in the Digital World
DESIGNING DATABASE APPLICATIONS
RDBMS CHAPTER - 2.
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.
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Relational Model Characteristics
CIS 207 The Relational Database Model
Lecture 2 The Relational Model
Chapter 4 Relational Databases
Chapter 3 The Relational Database Model
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Normalization Referential Integrity
Physical Database Design
Database solutions Database environment Marzena Nowakowska Faculty of Management and Computer Modelling Kielce University of Technology rooms: 3.21 C,
Database Systems: Design, Implementation, and Management Ninth Edition
Relational Database Design
Database Design: Relational Model
Design tools and techniques for a relational database system
The ultimate in data organization
DATABASE Purpose of database
Instructor Materials Chapter 5: Ensuring Integrity
Database Systems: Design, Implementation, and Management
Presentation transcript:

Relational data model

Codd's Rule E.F Codd was a Computer Scientist who invented Relational model for Database management. Based on relational model, Relation database was created. Codd proposed 13 rules popularly known as Codd's 12 rules to test DBMS's concept against his relational model. Even Oracle follows only eight and half out(8.5) of 13. The Codd's 12 rules are as follows.

I G S A C V H P L I D N InformationGuaranteed Access Systematic treatment of NULL Active Online Catalog Comprehensive data sublanguage High Level insert, update and delete Operation Physical Data Independence Logical Data Independence Integrity Independence Distribution Independence View Updation rule Non-subversion rule

Rule zero This rule states that for a system to qualify as an RDBMS, it must be able to manage database entirely through the relational capabilities.

Rule 1 : Information rule All information(including metadata) is to be represented as stored data in cells of tables. Everything in a database must be stored in a table format.

Rule 2 : Guaranteed Access Each unique piece of data(atomic value) should be accesible by : Table Name + primary key(Row) + Attribute(column). NOTE : Ability to directly access via POINTER is a violation of this rule.

Rule 3 : Systematic treatment of NULL Null has several meanings, it can mean missing data, not applicable or no value. It should be handled consistently. Primary key must not be null. Expression on NULL must give null.

Man + Man + Shoes = 20 Telescopes + Telescopes + Man = 13 Shoe + Man x Telescope = ?

The answer is 43. There are two shoes in each part of the first question, so there are six shoes altogether, so a single Shoe is worth 5. There are two Man and two shoes in the second part so a Man is also worth 5. There are two Telescopes and one Man in the third part, so a telescope is worth 2. Therefore a Shoe + a Man x Telescope = x 2 = 15 But here is the catch, The man(5) is wearing 2 shoes(10) and has held 2 telescopes(4) in the hand. So the man here is worth = 19. Therefore answer will be calculated as 1 shoe + 1 Man x 1 Telescope = x 2 = = 43

Rule 4 : Active Online Catalog (or) Database description rule Database dictionary(catalog) must have description of Database. The structure of the entire database must be stored in an online catalog, known as database dictionary. Catalog can be accessed by authorized users by using the same query language.

Rule 5 : Comprehensive data sublanguage One well defined language must be there to provide all manners of access to data. Example: SQL. If the data can be accessed without the help of this language, then it is considered as a violation. Rule 6 : View Updation rule All view that are theoretically updatable should be updatable by the system.

Rule 7 : High Level insert, update and delete Operation A database must support high-level Insert, Delete, Update operations. This must not be limited to a single row. Set operation like Union, Intersection and minus should also be supported. Rule 8 : Physical Data Independence Any change in the physical structure of the database must not affect the applications using it. If say, some file supporting table were renamed or moved from one disk to another, it should not effect the application.

Rule 9 : Logical Data Independence If there is change in the logical structure(table structures) of the database, the user view of data should not change. Rule 10 : Integrity Independence If any constraint is changed, this should not affect the application programs. Key and Check constraints, trigger etc should be stored in Data Dictionary. This also make RDBMS independent of front-end.

Rule 11 : Distribution Independence A database should work properly regardless of its distribution across a network. Rule 12 : Non-subversion rule When information is accessed, the language must use integrity constraints. This necessary for data integrity. This can be achieved by some sort of locking or encryption.

Components of Database Table structure In relational database, a table is collection of data elements organized in terms of rows and columns. But table can have duplicate rows while true relation can not have duplicate rows. Table is the most simplest form of data storage.

Record A single entry in a table is called a record or row. Tuple is nothing but a row. A record in a table represents set of related data.

Field A table consists of several records(row), each record can be broken into several smaller entities known as fields. Column(attributes) In relational table, a column is a set of values of a particular type. The term attribute is also used to represent a column.

Keys Key is an attribute or group of attributes used uniquely to identify a tuple or row in a table or relation. Super key, Candidate key, Primary Key, Foreign key, Unique key Unique Key

Super key Super key is the one which is able to determine any tuples/data/entity from record table. Super key can be a single attribute or a set of attributes. Here, super key can be a single attribute such as “(Roll No.)” or a collection of multiple attributes such as “(Name, Mobile No)” which can help in identification of record of every student.

Candidate key Candidate keys are similar to primary key. The only difference is, primary key for a table can only be one but candidate key can be more than one. Candidate key is also called as minimal super key with each tuple having unique value. The set of multiple keys possible for a relation is called candidate key and when suitable key is selected from that set, it is called primary key.

Here, Voter Id No, Passport No & PAN No can be termed as candidate keys because each of these can uniquely identify all the records present in the table.

primary key A primary key is a column -- or a group of columns -- in a table that uniquely identifies the rows in that table. For example, in the table below, BusinessEntityID, which displays the ID number assigned to different Persons, is the primary key.... In addition, nulls are not allowed in primary key columns.

Primary Key Properties Row values should not contains repeated values. The relationship between the primary key and the rest of the data is one to one. Null values are not allowed in the primary key column. Even though more than one column can be used a primary key it is always better to use minimum number of columns.

Foreign key A foreign key is nothing but an attribute that is commonly linked between two relation using that same attribute. Both the relations/tables must contain the same attribute. For example : Consider two relations R1(Roll No, Name, Marks) and R2(Roll No, Address, Age) of students of a school. Roll No being the common attribute will act as a key for relation R1 and can reference to Roll No attribute of relation R2 with the help of which any tuple can be retrieved from the tables.

Composite Key If more than one column are used as primary key then that key is called composite key.

Unique Keys A unique key is column or set of columns that is used for identifying a particular row. It is just like primarykey. But it allows null values in the key column.

Properties Unique key column values should not contain repeated values. The relationship between the unique key and the rest of the data is one to one. Even though more than one column can be used as unique key,it is always better to use minimum number of columns.

Meta Data Metadata is a data that provides information about other data. Descriptive Structural Administrative

Description Meta Data It describes the details for discovery and identification Example: 1. Title,abstract,author and keywords ii)Structural Meta Data It is a meta data about containers. Example: 1. How pages are ordered to form chapters. 2. Describes types,versions,relationships and other characteristics od digital materials iii)Administrative Meta Data: It proves the information to manage a resource. Example: 1. When and how it was created 2. File type 3. Who can access it.

Data Dictionary The data dictionary stores the definitions of all database tables. It also called data about data. This gives the description about the data. This allows the DBMS to keep track of the data and helps the user to find the need data. Most modern database system hold the data dictionary as a set of system tables. These tables are used by the system and the user will rarely use them directly.

The contents of the data dictionary What data is available? Where the data is stored? Who owns the data? How is the data used? Who can access the data?

Data Integrity DBMS Entity Integrity: No duplicate rows in the table. Domain Integrity: Enforces valid entries for given column by type format or range of values. Referential Integrity: Rows can not deleted which are used by other records. User defined Integrity: Enforces some specific business rules that do not fall into entity, domain or referential integrity.

Data Constraints Data constraints are policies to maintain accuracy and integrity of data in the database during database operations. Constraints could be column level or table level. Types of Constraints (1) Entity integrity constraint (i) Unique constraint (ii) Primary key constraint (2) Domain integrity constraint (i) Not null constraint (ii) Default constraint (3) Referential integrity constraint (or) Foreign key constraint

Entity Integrity constraint It is used to enforce unique key and primary key in the database. The following are the two types of Entity integrity constraints. (i) Unique constraint (ii) Primary key constraint

(i) Unique constraint Unique constraint ensures that each row for a column or a set of columns must have a unique value. But null values are allowed for that column. If this constraint is assigned to more than one column, it is called “composite unique key”. Creating unique constraint

Unique Constraint

(ii) Primary key constraint Primary key constraint ensures that each row for a column or a set of columns must have a unique value. Here, null values are not allowed. If this constraint is assigned to more than one column, it is called “composite primary key”.

Domain Integrity constraint Domain Integrity constraint is used to verify whether the data entered is in proper form and range. The following are the two types of Domain integrity constraints. (i) Not null constraint (ii) Default constraint

(i) Not null constraint Not null constraint ensures that a column cannot have “NULL” value. This is used to make the user to enter values for the column compulsory.

(ii) Default constraint Default constraint provides a default value for a column. The default value is used if no value is specified for that field when inserting a record.

Referential Integrity constraint (or) Foreign key constraint Referential integrity constraint or foreign key constraint ensures that a column or set of columns in one table must have matching values in the primary key column of another table. The referring table is called child table and the referred table is called child table.