SlideShare a Scribd company logo
1 of 18
RELATIONAL DATA MODEL
Presented By:
Vaishali Ashok Chinchkhede
Department OF Computer Science
DATABASE SCHEMA
 A database schema is the selection structure that represent the logical view of the entire
database.
 It define how the data is organized and how the relation among item are associated is
formulated all the constraints that are to be applied on the data.
 A database schema it’s a entity and the relationship among them it contain a descriptive
details of the database which can be represented by the schema diagram.
SHOW IN FIGURE DATABASE SCHEMA
 It is a database designs who design the schema to help programmers
understand the database is useful.
___________________________________________
______

Database Schema
View 1 View2 View3
Std_Id Std_Name Std_Add
Physical
Schema
DATABASE SCHEMA CAN BE DIVIDED INTO TWO TYPE
 Logical Database Schema:-
 Physical Database Schema:-
LOGICAL DATABASE SCHEMA
 This schema defines all the logical constrains that need to be applied on the data store.
 It defines table view and constraints logical schema is data model of a specific problem
domain expressed independtly of a particular database management product or storage
technology(physical schema)but in terms of data structure such as a realational table and
column object oriented classes.
PHYSICAL DATABASE SCHEMA
 Physical database schema is representation of data design as implemented or intended to
be implemented in database management system.
 Physical schema data model to calculate storage allocation details for a given database
system.
CONSTRAINTS
 In DBMS constraints are imposed on every realation (table) to ensure that only correct
and accepted value are inserted into table. These are used to limit the type of data that can
go into a table.
 Constraints could be table column level are table row level.
 Column table constraints are applied only to 1 column where as a table level constraints
are applied to the whole table.
EXAMPLE OF CONSTRAINTS
ID Name Class Contact_no
1 Dipa BCS fy 956238412
2 Rupa BBA 7845126359
3 Vaishu BCS 7458923612
4 Sonu BBA 8486825476
5 Renu BCA 8795412386S
THERE ARE THREE TYPE OF INTEGRITY CONSTRAINTS
 Domain Constraints
 Entity Integrity Constraints
 Referential Entity Integrity Constrains
INTEGRITY CONSTRAINTS
 Integrity constraints maintain security and integrity of the database is the most important
factor of a system.
 Integrity Constraints is a mechanism use to present invalid data entire into table.
 Integrity Constraints ensure that changes make to the database authorized user is not in a
loss of data consistency.
 For Example
 Account balance cannot be null.
DOMAIN CONSTRAINTS
 The Condition of Restriction associated with a particular domain (column)
 Create Person Table
{
In int Not Null
Name varchar(15) Not Null
Age int
};
EXAMPLE OF DOMAIN CONSTRAINTS
Data type Integer ,Character , Float.
Domain Name Domain Constraints
ID Data type Not Null
Name Data type Maximum Character Not Null
Age Data type is null value allowed
ENTITY INTEGRITY CONSTRAINTS( PRIMARY KEY)
 A primary key is a field in a table which uniquely identify each row column in database.
 A primary key must be contained unique value.
 A primary key column cannot have null value.
 A table can have only one primary key which may consider of single as multiple filed.
EXAMPLE OF INTEGRITY CONSTRAINTS
Create table Student
{
ID int NOT Null primary key
name Varchar(20) not null
Contact int
};
TABLE FOR ENTITY INTEGRITY CONSTRAINTS
Stud_ID Stud_Name Stud_ Contact
Primary KEY 1 Savita 7899066556
2 Kavita 9876457832
3 Anita 7876543789
4 Rita 7543858682
DELETE PRIMARY KEY
 You can clear in our student table if we want to delete a single record we can use
where clause to provide a condition in our delete statement.
 Delete from student where S_ID
Stud_Name Stud_ Contact
Savita 7899066556
Kavita 9876457832
Anita 7876543789
Rita 7543858682
REFERENTIAL ENTITY INTEGRITY CONSTRAINT( FOREIGN KEY)
 A foreign key is a key use to a link two table.
 This sometimes called as a reference key and foreign key is a column or a combination
of a column whose value match a primary key in a different table.
 The Relationship between two tables matches the primary key is one of the table with a
foreign key in a second table.
 If a table has a primary key define and any field then you can not have to record having
same value of that field.
EXAMPLE FOR REFERENTIAL ENTITY INTEGRITY CONSTRAINTS
 Example :- Consider the table for Student Admission
Foreign
Key using
In next
table
Table for
Hostel
Roll_No Course Course Address
1 Sandeep BCA N3
2 Swapnil BBA N8
3 Anju BCA N6
4 Renu BCS N12
Roll_No Hostel Room No
1 111
2 112
3 113
4 114

More Related Content

What's hot

Database constraints
Database constraintsDatabase constraints
Database constraintsHarry Potter
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databasesSperasoft
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in DatabaseA. S. M. Shafi
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationEduonix Learning Solutions
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization TechniquesNishant Munjal
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
MS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesMS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesDataminingTools Inc
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraintsVivek Singh
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joinsDeepthi Rachumallu
 
Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationNickkisha Farrell
 

What's hot (20)

Database constraints
Database constraintsDatabase constraints
Database constraints
 
Queries
QueriesQueries
Queries
 
The theory of relational databases
The theory of relational databasesThe theory of relational databases
The theory of relational databases
 
Persentation of SAD 2
Persentation of SAD 2Persentation of SAD 2
Persentation of SAD 2
 
Normalization in Database
Normalization in DatabaseNormalization in Database
Normalization in Database
 
Join sql
Join sqlJoin sql
Join sql
 
Anomalies in database
Anomalies in databaseAnomalies in database
Anomalies in database
 
Denormalization
DenormalizationDenormalization
Denormalization
 
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalizationLearn Database Design with MySQL - Chapter 5 - Design principles & normalization
Learn Database Design with MySQL - Chapter 5 - Design principles & normalization
 
Database anomalies
Database anomaliesDatabase anomalies
Database anomalies
 
Database Design and Normalization Techniques
Database Design and Normalization TechniquesDatabase Design and Normalization Techniques
Database Design and Normalization Techniques
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
Joins in SQL
Joins in SQLJoins in SQL
Joins in SQL
 
joins in database
 joins in database joins in database
joins in database
 
MS Sql Server: Joining Databases
MS Sql Server: Joining DatabasesMS Sql Server: Joining Databases
MS Sql Server: Joining Databases
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Year 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st TermYear 11 DATA PROCESSING 1st Term
Year 11 DATA PROCESSING 1st Term
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
 
Database Management Systems 4 - Normalization
Database Management Systems 4 - NormalizationDatabase Management Systems 4 - Normalization
Database Management Systems 4 - Normalization
 

Similar to Relational data model

Sql server ___________session_15(data integrity)
Sql server  ___________session_15(data integrity)Sql server  ___________session_15(data integrity)
Sql server ___________session_15(data integrity)Ehtisham Ali
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part IIKavithaA19
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfDraguClaudiu
 
Database Concepts.pptx
Database Concepts.pptxDatabase Concepts.pptx
Database Concepts.pptxDhruvSavaliya9
 
SQL dabatase interveiw pdf for interveiw preparation
SQL dabatase  interveiw pdf for interveiw preparationSQL dabatase  interveiw pdf for interveiw preparation
SQL dabatase interveiw pdf for interveiw preparationkumarvikesh2841998
 
Sql interview q&a
Sql interview q&aSql interview q&a
Sql interview q&aSyed Shah
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Prosanta Ghosh
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databasePradnya Saval
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems incMuthu Natarajan
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database ModelsPrithwis Mukerjee
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database ModelsPrithwis Mukerjee
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESNathRam2
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDev Chauhan
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7Syed Asrarali
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In SqlAnurag
 

Similar to Relational data model (20)

Sql server ___________session_15(data integrity)
Sql server  ___________session_15(data integrity)Sql server  ___________session_15(data integrity)
Sql server ___________session_15(data integrity)
 
Relational Database Management System part II
Relational Database Management System part IIRelational Database Management System part II
Relational Database Management System part II
 
DATABASE-1.pptx
DATABASE-1.pptxDATABASE-1.pptx
DATABASE-1.pptx
 
SQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdfSQL -Beginner To Intermediate Level.pdf
SQL -Beginner To Intermediate Level.pdf
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
Database Concepts.pptx
Database Concepts.pptxDatabase Concepts.pptx
Database Concepts.pptx
 
SQL dabatase interveiw pdf for interveiw preparation
SQL dabatase  interveiw pdf for interveiw preparationSQL dabatase  interveiw pdf for interveiw preparation
SQL dabatase interveiw pdf for interveiw preparation
 
Assignment#07
Assignment#07Assignment#07
Assignment#07
 
Sql interview q&a
Sql interview q&aSql interview q&a
Sql interview q&a
 
Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013Dbms ii mca-ch4-relational model-2013
Dbms ii mca-ch4-relational model-2013
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Understanding about relational database m-square systems inc
Understanding about relational database m-square systems incUnderstanding about relational database m-square systems inc
Understanding about relational database m-square systems inc
 
RDBMS
RDBMSRDBMS
RDBMS
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
BIS06 Physical Database Models
BIS06 Physical Database ModelsBIS06 Physical Database Models
BIS06 Physical Database Models
 
Integrity and security
Integrity and securityIntegrity and security
Integrity and security
 
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLESDATABASE CONCEPTS AND PRACTICAL EXAMPLES
DATABASE CONCEPTS AND PRACTICAL EXAMPLES
 
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQLDATABASE MANAGMENT SYSTEM (DBMS) AND SQL
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
 
Intro to tsql unit 7
Intro to tsql   unit 7Intro to tsql   unit 7
Intro to tsql unit 7
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 

Recently uploaded

Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxpradhanghanshyam7136
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTSérgio Sacani
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRDelhi Call girls
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptMAESTRELLAMesa2
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Sérgio Sacani
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PPRINCE C P
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physicsvishikhakeshava1
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxUmerFayaz5
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsAArockiyaNisha
 
Luciferase in rDNA technology (biotechnology).pptx
Luciferase in rDNA technology (biotechnology).pptxLuciferase in rDNA technology (biotechnology).pptx
Luciferase in rDNA technology (biotechnology).pptxAleenaTreesaSaji
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfnehabiju2046
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxyaramohamed343013
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfSwapnil Therkar
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bSérgio Sacani
 

Recently uploaded (20)

9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
9953056974 Young Call Girls In Mahavir enclave Indian Quality Escort service
 
Cultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptxCultivation of KODO MILLET . made by Ghanshyam pptx
Cultivation of KODO MILLET . made by Ghanshyam pptx
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCRStunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
Stunning ➥8448380779▻ Call Girls In Panchshil Enclave Delhi NCR
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.ppt
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Mayapuri Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C P
 
Work, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE PhysicsWork, Energy and Power for class 10 ICSE Physics
Work, Energy and Power for class 10 ICSE Physics
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 
Natural Polymer Based Nanomaterials
Natural Polymer Based NanomaterialsNatural Polymer Based Nanomaterials
Natural Polymer Based Nanomaterials
 
Luciferase in rDNA technology (biotechnology).pptx
Luciferase in rDNA technology (biotechnology).pptxLuciferase in rDNA technology (biotechnology).pptx
Luciferase in rDNA technology (biotechnology).pptx
 
The Philosophy of Science
The Philosophy of ScienceThe Philosophy of Science
The Philosophy of Science
 
A relative description on Sonoporation.pdf
A relative description on Sonoporation.pdfA relative description on Sonoporation.pdf
A relative description on Sonoporation.pdf
 
Scheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docxScheme-of-Work-Science-Stage-4 cambridge science.docx
Scheme-of-Work-Science-Stage-4 cambridge science.docx
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 

Relational data model

  • 1. RELATIONAL DATA MODEL Presented By: Vaishali Ashok Chinchkhede Department OF Computer Science
  • 2. DATABASE SCHEMA  A database schema is the selection structure that represent the logical view of the entire database.  It define how the data is organized and how the relation among item are associated is formulated all the constraints that are to be applied on the data.  A database schema it’s a entity and the relationship among them it contain a descriptive details of the database which can be represented by the schema diagram.
  • 3. SHOW IN FIGURE DATABASE SCHEMA  It is a database designs who design the schema to help programmers understand the database is useful. ___________________________________________ ______  Database Schema View 1 View2 View3 Std_Id Std_Name Std_Add Physical Schema
  • 4. DATABASE SCHEMA CAN BE DIVIDED INTO TWO TYPE  Logical Database Schema:-  Physical Database Schema:-
  • 5. LOGICAL DATABASE SCHEMA  This schema defines all the logical constrains that need to be applied on the data store.  It defines table view and constraints logical schema is data model of a specific problem domain expressed independtly of a particular database management product or storage technology(physical schema)but in terms of data structure such as a realational table and column object oriented classes.
  • 6. PHYSICAL DATABASE SCHEMA  Physical database schema is representation of data design as implemented or intended to be implemented in database management system.  Physical schema data model to calculate storage allocation details for a given database system.
  • 7. CONSTRAINTS  In DBMS constraints are imposed on every realation (table) to ensure that only correct and accepted value are inserted into table. These are used to limit the type of data that can go into a table.  Constraints could be table column level are table row level.  Column table constraints are applied only to 1 column where as a table level constraints are applied to the whole table.
  • 8. EXAMPLE OF CONSTRAINTS ID Name Class Contact_no 1 Dipa BCS fy 956238412 2 Rupa BBA 7845126359 3 Vaishu BCS 7458923612 4 Sonu BBA 8486825476 5 Renu BCA 8795412386S
  • 9. THERE ARE THREE TYPE OF INTEGRITY CONSTRAINTS  Domain Constraints  Entity Integrity Constraints  Referential Entity Integrity Constrains
  • 10. INTEGRITY CONSTRAINTS  Integrity constraints maintain security and integrity of the database is the most important factor of a system.  Integrity Constraints is a mechanism use to present invalid data entire into table.  Integrity Constraints ensure that changes make to the database authorized user is not in a loss of data consistency.  For Example  Account balance cannot be null.
  • 11. DOMAIN CONSTRAINTS  The Condition of Restriction associated with a particular domain (column)  Create Person Table { In int Not Null Name varchar(15) Not Null Age int };
  • 12. EXAMPLE OF DOMAIN CONSTRAINTS Data type Integer ,Character , Float. Domain Name Domain Constraints ID Data type Not Null Name Data type Maximum Character Not Null Age Data type is null value allowed
  • 13. ENTITY INTEGRITY CONSTRAINTS( PRIMARY KEY)  A primary key is a field in a table which uniquely identify each row column in database.  A primary key must be contained unique value.  A primary key column cannot have null value.  A table can have only one primary key which may consider of single as multiple filed.
  • 14. EXAMPLE OF INTEGRITY CONSTRAINTS Create table Student { ID int NOT Null primary key name Varchar(20) not null Contact int };
  • 15. TABLE FOR ENTITY INTEGRITY CONSTRAINTS Stud_ID Stud_Name Stud_ Contact Primary KEY 1 Savita 7899066556 2 Kavita 9876457832 3 Anita 7876543789 4 Rita 7543858682
  • 16. DELETE PRIMARY KEY  You can clear in our student table if we want to delete a single record we can use where clause to provide a condition in our delete statement.  Delete from student where S_ID Stud_Name Stud_ Contact Savita 7899066556 Kavita 9876457832 Anita 7876543789 Rita 7543858682
  • 17. REFERENTIAL ENTITY INTEGRITY CONSTRAINT( FOREIGN KEY)  A foreign key is a key use to a link two table.  This sometimes called as a reference key and foreign key is a column or a combination of a column whose value match a primary key in a different table.  The Relationship between two tables matches the primary key is one of the table with a foreign key in a second table.  If a table has a primary key define and any field then you can not have to record having same value of that field.
  • 18. EXAMPLE FOR REFERENTIAL ENTITY INTEGRITY CONSTRAINTS  Example :- Consider the table for Student Admission Foreign Key using In next table Table for Hostel Roll_No Course Course Address 1 Sandeep BCA N3 2 Swapnil BBA N8 3 Anju BCA N6 4 Renu BCS N12 Roll_No Hostel Room No 1 111 2 112 3 113 4 114