SlideShare a Scribd company logo
1 of 13
Download to read offline
UNIT II
❑RDBMS:INTRODUCTION
❑TERMINOLOGY
❑RELATIONAL DATA STRUCTURE
❑RELATIONAL DATA INTEGRITY
❑RELATIONAL DATA MANIPULATION
❑CODD’S RULES
RDBMS:INTRODUCTION
RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL,
and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and
Microsoft Access.
A Relational database management system (RDBMS) is a database management
system (DBMS) that is based on the relational model as introduced by E. F. Codd.
TERMINOLOGY
The data in an RDBMS is stored in database objects which are called as tables. This table
is basically a collection of related data entries and it consists of numerous columns and
rows.
Every table is broken up into smaller entities called fields. The fields in the CUSTOMERS
table consist of ID, NAME, AGE, ADDRESS and SALARY.
A record is also called as a row of data is each individual entry that exists in a table. For
example, there are 7 records in the above CUSTOMERS table.
A column is a vertical entity in a table that contains all information associated with a
specific field in a table.
A NULL value in a table is a value in a field that appears to be blank, which means a field
with a NULL value is a field with no value.
Primary Key
Every table has one Primary key and cannot have null values.
Foreign Key
If you want to link two tables, use Foreign Key.
For example, Employee table has DEPT_ID that is a foreign key, which is linked
to Department table.
The Department table has primary key DEPT_ID.
Super Key
Super Key is an attribute (or a set of attributes) that uniquely identify a tuple i.e.
an entity in entity set. It is a superset of Candidate Key, since Candidate Keys
are selectedfrom super key.
Composite Key
A primary key having two or more attributes is calledcomposite key. It is a
combination of two or more columns.
RELATIONAL DATA STRUCTURE
In relational model, the data and relationships are represented by collection
of inter-relatedtables. Each table is a group of columnand rows, where
column represents attribute of an entity and rows represents records.
Sample relationship Model: Student table with 3 columns and four records.
Stu_Id Stu_Name Stu_Age
111 Ashish 23
123 Saurav 22
169 Lester 24
234 Sam 26
Tables − In relational data model, relations are saved in the format of Tables.
This format stores the relation among entities. A table has rows and columns,
where rows represents records and columns represent the attributes.
Tuple − A single row of a table, which contains a singlerecord for that relation
is calleda tuple.
Relation instance − A finite set of tuples in the relational database system
represents relation instance. Relation instances do not have duplicate tuples.
Relation schema − A relation schemadescribes the relation name (table
name), attributes, and their names.
Relation key − Each row has one or more attributes, known as relation key,
which can identify the row in the relation (table) uniquely.
Attribute domain − Every attribute has some pre-defined value scope, known
as attribute domain.
Data integrityis enforced in both hierarchical and relational database
models. The following three integrityconstraints are used in a relational
database structure to achieve data integrity:
Entity Integrity: This is concerned with the concept of primary keys. The
rule states that every table must have its own primary key and that
each has to be unique and not null.
Referential Integrity: This is the concept of foreign keys. The rule states
that the foreign key value can be in two states. The first state is that the
foreign key value wouldrefer to a primary key value of another table,
or it can be null. Being null could simply mean that there are no
relationships, or that the relationship is unknown.
Domain Integrity:This states that all columns in a relational database
are in a defined domain.
RELATIONAL DATA INTEGRITY
RELATIONAL DATA MANIPULATION
A data manipulation language (DML) is a computer programming language used for adding
(inserting), deleting, and modifying (updating) data in a database A DML is often
a sublanguage of a broader database language such as SQL,with the DML comprising some
of the operators in the language.
DML commands are used to modify the database. It is responsible for all form of changes in
the database
INSERT
UPDATE
DELETE
INSERT: The INSERT statement is a SQL query. It is used to insert data into the row of a table.
Syntax:
Syntax:
INSERT INTO TABLE_NAME
(col1, col2, col3,.... col N)
VALUES (value1, value2, value3, .... valueN);
UPDATE: This commandis used to update or modify the value of a column in
the table.
Syntax:
UPDATE table_name SET [column_name1= value1,...column_nameN = valueN]
[WHERE CONDITION]
DELETE: It is used to removeone or more row from a table.
Syntax:
DELETE FROM table_name [WHERE condition];
Codd's Rule for Relational DBMS
E.F Codd was a Computer Scientist who inventedthe Relational model for
Database management. Based on relational model,the Relational
database was created. Codd proposed 13 rules popularly known as Codd's 12
rules to test DBMS's concept against his relational model. Codd's rule actualy
define what quality a DBMS requires in order to become a Relational
Database Management System(RDBMS).
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. The rows and columns have to be strictlyunordered.
Rule 2: Guaranted Access
Each unique piece of data(atomic value)shouldbe accesible by : Table
Name + Primary Key(Row) + Attribute(column).
Rule 3: Systematictreatment of NULL
Null has severalmeanings, it can mean missing data, not applicable or no value.It should be handled
consistently. Also, Primary key must not be null, ever.Expression on must givenull.
Rule 4: Active Online Catalog
Database dictionary(catalog) is the structuredescription of the complete Database and it must be
stored online. The Catalog must be governed by same rules as rest of the database. The same query
languageshould be used on catalog as used to query database.
Rule 5: The comprehensivedata sublanguagerule:
relational system may support severallanguagesand variousmodes of terminal use (for example, the
fill-in-the-blanks mode). However,theremust be at least one languagewhose statementsare
expressible, per some well-defined syntax,as character strings and that is comprehensivein supporting
all of the following items:Data definition.
View definition.
Data manipulation (interactiveand by program).
Integrityconstraints.
Authorization.
Transaction boundaries (begin, commit and rollback).
Rule 6: The view updating rule:All viewsthat are theoretically updatableare also updatable by the
system.
Rule 7: Relational Level Operation
There must be Insert,Delete, Update operations at each level of relations. Set operation like Union,
Intersection and minus should also be supported.
Rule 8: Physical Data Independence
The physical storage of data should not matter to the system. If say, some file supporting table is
renamed or moved from one disk to another,it should not effect the application.
Rule 9: Logical Data Independence
If there is changein the logical structure(tablestructures) of the database the user view of data
should not change.Say, if a table is split into two tables, a new view should giveresult as the join of
the two tables.
Rule 10: Integrity Independence
The databaseshould be able to enforce its own integrity rather than using other programs. Key and
Check constraints,trigger etc, should be stored in Data Dictionary.
Rule 11: DistributionIndependence
A database should work properly regardless of its distribution across a network.Even if a database is
geographically distributed, with data stored in pieces, the end user should get an impression that it is
stored at the same place.
Rule 12: Nonsubversion Rule
If low level access is allowed to a system it should not be able to subvertor bypass integrity rules to
changethe data.
RDBMS

More Related Content

What's hot

DBMS - Relational Model
DBMS - Relational ModelDBMS - Relational Model
DBMS - Relational ModelOvais Imtiaz
 
Database basics
Database basicsDatabase basics
Database basicsprachin514
 
Database management system
Database management systemDatabase management system
Database management systemedudivya
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And AnswerJagan Mohan Bishoyi
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database languageJafar Nesargi
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]Bashir Rezaie
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database FundamentalsKHALID C
 
Relational database revised
Relational database revisedRelational database revised
Relational database revisedmnodalo
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...Mustafa Kamel Mohammadi
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- FundamentalsMohammed El Hedhly
 
SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4jeetendra mandal
 

What's hot (20)

DBMS - Relational Model
DBMS - Relational ModelDBMS - Relational Model
DBMS - Relational Model
 
Database basics
Database basicsDatabase basics
Database basics
 
Rdbms concepts
Rdbms conceptsRdbms concepts
Rdbms concepts
 
Database management system
Database management systemDatabase management system
Database management system
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
Relational model
Relational modelRelational model
Relational model
 
RDBMS.
RDBMS.RDBMS.
RDBMS.
 
Dbms relational data model and sql queries
Dbms relational data model and sql queries Dbms relational data model and sql queries
Dbms relational data model and sql queries
 
Denormalization
DenormalizationDenormalization
Denormalization
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
The relational data model part[1]
The relational data model part[1]The relational data model part[1]
The relational data model part[1]
 
Relational Database Fundamentals
Relational Database FundamentalsRelational Database Fundamentals
Relational Database Fundamentals
 
Relational database revised
Relational database revisedRelational database revised
Relational database revised
 
Fundamentals of database system - Relational data model and relational datab...
Fundamentals of database system  - Relational data model and relational datab...Fundamentals of database system  - Relational data model and relational datab...
Fundamentals of database system - Relational data model and relational datab...
 
Database Basics Theory
Database Basics TheoryDatabase Basics Theory
Database Basics Theory
 
Sql commands
Sql commandsSql commands
Sql commands
 
Relational database- Fundamentals
Relational database- FundamentalsRelational database- Fundamentals
Relational database- Fundamentals
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
 
SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4
 

Similar to RDBMS (20)

Codds rules & keys
Codds rules & keysCodds rules & keys
Codds rules & keys
 
RDBMS_Concept.ppt
RDBMS_Concept.pptRDBMS_Concept.ppt
RDBMS_Concept.ppt
 
Database Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdfDatabase Concepts & SQL(1).pdf
Database Concepts & SQL(1).pdf
 
Dbms 9: Relational Model
Dbms 9: Relational ModelDbms 9: Relational Model
Dbms 9: Relational Model
 
COMPUTERS Database
COMPUTERS Database COMPUTERS Database
COMPUTERS Database
 
Database fundamentals
Database fundamentalsDatabase fundamentals
Database fundamentals
 
Sql interview questions and answers
Sql interview questions and  answersSql interview questions and  answers
Sql interview questions and answers
 
PPT_DBMS.pptx
PPT_DBMS.pptxPPT_DBMS.pptx
PPT_DBMS.pptx
 
DATA BASE MODEL Rohini
DATA BASE MODEL RohiniDATA BASE MODEL Rohini
DATA BASE MODEL Rohini
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
Updated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptxUpdated_rdbms-161216100344 (1).pptx
Updated_rdbms-161216100344 (1).pptx
 
Oracle
OracleOracle
Oracle
 
RDBMS
RDBMSRDBMS
RDBMS
 
Dbms interview ques
Dbms interview quesDbms interview ques
Dbms interview ques
 
rdbms-161216100344 (1).pdf
rdbms-161216100344 (1).pdfrdbms-161216100344 (1).pdf
rdbms-161216100344 (1).pdf
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
DBMS
DBMSDBMS
DBMS
 
Database Management System ppt
Database Management System pptDatabase Management System ppt
Database Management System ppt
 
csedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdfcsedatabasemanagementsystemppt-170825044344.pdf
csedatabasemanagementsystemppt-170825044344.pdf
 
D B M S Animate
D B M S AnimateD B M S Animate
D B M S Animate
 

Recently uploaded

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Recently uploaded (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 

RDBMS

  • 1.
  • 2. UNIT II ❑RDBMS:INTRODUCTION ❑TERMINOLOGY ❑RELATIONAL DATA STRUCTURE ❑RELATIONAL DATA INTEGRITY ❑RELATIONAL DATA MANIPULATION ❑CODD’S RULES
  • 3. RDBMS:INTRODUCTION RDBMS stands for Relational Database Management System. RDBMS is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd. TERMINOLOGY The data in an RDBMS is stored in database objects which are called as tables. This table is basically a collection of related data entries and it consists of numerous columns and rows. Every table is broken up into smaller entities called fields. The fields in the CUSTOMERS table consist of ID, NAME, AGE, ADDRESS and SALARY. A record is also called as a row of data is each individual entry that exists in a table. For example, there are 7 records in the above CUSTOMERS table. A column is a vertical entity in a table that contains all information associated with a specific field in a table. A NULL value in a table is a value in a field that appears to be blank, which means a field with a NULL value is a field with no value.
  • 4. Primary Key Every table has one Primary key and cannot have null values. Foreign Key If you want to link two tables, use Foreign Key. For example, Employee table has DEPT_ID that is a foreign key, which is linked to Department table. The Department table has primary key DEPT_ID. Super Key Super Key is an attribute (or a set of attributes) that uniquely identify a tuple i.e. an entity in entity set. It is a superset of Candidate Key, since Candidate Keys are selectedfrom super key. Composite Key A primary key having two or more attributes is calledcomposite key. It is a combination of two or more columns.
  • 5. RELATIONAL DATA STRUCTURE In relational model, the data and relationships are represented by collection of inter-relatedtables. Each table is a group of columnand rows, where column represents attribute of an entity and rows represents records. Sample relationship Model: Student table with 3 columns and four records. Stu_Id Stu_Name Stu_Age 111 Ashish 23 123 Saurav 22 169 Lester 24 234 Sam 26
  • 6. Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among entities. A table has rows and columns, where rows represents records and columns represent the attributes. Tuple − A single row of a table, which contains a singlerecord for that relation is calleda tuple. Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances do not have duplicate tuples. Relation schema − A relation schemadescribes the relation name (table name), attributes, and their names. Relation key − Each row has one or more attributes, known as relation key, which can identify the row in the relation (table) uniquely. Attribute domain − Every attribute has some pre-defined value scope, known as attribute domain.
  • 7. Data integrityis enforced in both hierarchical and relational database models. The following three integrityconstraints are used in a relational database structure to achieve data integrity: Entity Integrity: This is concerned with the concept of primary keys. The rule states that every table must have its own primary key and that each has to be unique and not null. Referential Integrity: This is the concept of foreign keys. The rule states that the foreign key value can be in two states. The first state is that the foreign key value wouldrefer to a primary key value of another table, or it can be null. Being null could simply mean that there are no relationships, or that the relationship is unknown. Domain Integrity:This states that all columns in a relational database are in a defined domain. RELATIONAL DATA INTEGRITY
  • 8. RELATIONAL DATA MANIPULATION A data manipulation language (DML) is a computer programming language used for adding (inserting), deleting, and modifying (updating) data in a database A DML is often a sublanguage of a broader database language such as SQL,with the DML comprising some of the operators in the language. DML commands are used to modify the database. It is responsible for all form of changes in the database INSERT UPDATE DELETE INSERT: The INSERT statement is a SQL query. It is used to insert data into the row of a table. Syntax: Syntax: INSERT INTO TABLE_NAME (col1, col2, col3,.... col N) VALUES (value1, value2, value3, .... valueN);
  • 9. UPDATE: This commandis used to update or modify the value of a column in the table. Syntax: UPDATE table_name SET [column_name1= value1,...column_nameN = valueN] [WHERE CONDITION] DELETE: It is used to removeone or more row from a table. Syntax: DELETE FROM table_name [WHERE condition];
  • 10. Codd's Rule for Relational DBMS E.F Codd was a Computer Scientist who inventedthe Relational model for Database management. Based on relational model,the Relational database was created. Codd proposed 13 rules popularly known as Codd's 12 rules to test DBMS's concept against his relational model. Codd's rule actualy define what quality a DBMS requires in order to become a Relational Database Management System(RDBMS). 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. The rows and columns have to be strictlyunordered. Rule 2: Guaranted Access Each unique piece of data(atomic value)shouldbe accesible by : Table Name + Primary Key(Row) + Attribute(column).
  • 11. Rule 3: Systematictreatment of NULL Null has severalmeanings, it can mean missing data, not applicable or no value.It should be handled consistently. Also, Primary key must not be null, ever.Expression on must givenull. Rule 4: Active Online Catalog Database dictionary(catalog) is the structuredescription of the complete Database and it must be stored online. The Catalog must be governed by same rules as rest of the database. The same query languageshould be used on catalog as used to query database. Rule 5: The comprehensivedata sublanguagerule: relational system may support severallanguagesand variousmodes of terminal use (for example, the fill-in-the-blanks mode). However,theremust be at least one languagewhose statementsare expressible, per some well-defined syntax,as character strings and that is comprehensivein supporting all of the following items:Data definition. View definition. Data manipulation (interactiveand by program). Integrityconstraints. Authorization. Transaction boundaries (begin, commit and rollback). Rule 6: The view updating rule:All viewsthat are theoretically updatableare also updatable by the system.
  • 12. Rule 7: Relational Level Operation There must be Insert,Delete, Update operations at each level of relations. Set operation like Union, Intersection and minus should also be supported. Rule 8: Physical Data Independence The physical storage of data should not matter to the system. If say, some file supporting table is renamed or moved from one disk to another,it should not effect the application. Rule 9: Logical Data Independence If there is changein the logical structure(tablestructures) of the database the user view of data should not change.Say, if a table is split into two tables, a new view should giveresult as the join of the two tables. Rule 10: Integrity Independence The databaseshould be able to enforce its own integrity rather than using other programs. Key and Check constraints,trigger etc, should be stored in Data Dictionary. Rule 11: DistributionIndependence A database should work properly regardless of its distribution across a network.Even if a database is geographically distributed, with data stored in pieces, the end user should get an impression that it is stored at the same place. Rule 12: Nonsubversion Rule If low level access is allowed to a system it should not be able to subvertor bypass integrity rules to changethe data.