Download presentation
Presentation is loading. Please wait.
Published byashok kumar Modified over 5 years ago
1
Relational data model
2
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.
3
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
5
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.
6
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.
7
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.
8
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.
10
Man + Man + Shoes = 20 Telescopes + Telescopes + Man = 13 Shoe + Man x Telescope = ?
11
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 = 5 + 5 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 5+10+4 = 19. Therefore answer will be calculated as 1 shoe + 1 Man x 1 Telescope = 5 + 19 x 2 = 5 + 38 = 43
12
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.
13
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.
14
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.
15
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.
16
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.
17
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.
19
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.
20
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.
21
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
22
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.
23
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.
24
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.
25
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.
26
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.
27
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.
28
Composite Key If more than one column are used as primary key then that key is called composite key.
30
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.
31
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. www.minigranth.com
32
Meta Data Metadata is a data that provides information about other data. Descriptive Structural Administrative
33
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.
34
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.
35
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?
36
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.
37
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
38
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
39
(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
40
Unique Constraint
41
(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”.
43
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
44
(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.
45
(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.
46
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.