SlideShare a Scribd company logo
1 of 10
Integrity constraints
Presented by:
Madhav and Varsha
Integrity constraints
Different types of integrity
• There are the domain integrity,
• the entity integrity, t
• he referential integrity and
• the foreign key integrity
constraints.
Integrity
Constraints
Referential
Entity
TupleKey
Domain
Domain Integrity
• Domain integrity means the definition of a valid set of values for an attribute. You
define
- data type,
- lenght or size
- is null value allowed
- is the value unique or not
for an attribute.
You may also define the default value, the range (values in between) and/or specific
values for the attribute. Some DBMS allow you to define the output format and/or input
mask for the attribute.
These definitions ensure that a specific attribute will have a right and proper value in
the database.
Entity Integrity Constraint
• The entity integrity constraint states that primary keys can't be null. There must be a proper value in the
primary key field.
This is because the primary key value is used to identify individual rows in a table. If there were null values for
primary keys, it would mean that we could not indentify those rows.
On the other hand, there can be null values other than primary key fields. Null value means that one doesn't
know the value for that field. Null value is different from zero value or space.
In the Car Rental database in the Car table each car must have a proper and unique Reg_No. There might be
a car whose rate is unknown - maybe the car is broken or it is brand new - i.e. the Rate field has a null value.
See the picture below.
The entity integrity constraints assure that a spesific row in a table can be identified.
• Picture. Car and CarType tables in the Rent database
Referential Integrity Constraint
• The referential integrity constraint is specified between two tables and it is used to maintain the consistency
among rows between the two tables.
The rules are:
1. You can't delete a record from a primary table if matching records exist in a related table.
2. You can't change a primary key value in the primary table if that record has related records.
3. You can't enter a value in the foreign key field of the related table that doesn't exist in the primary key of the
primary table.
4. However, you can enter a Null value in the foreign key, specifying that the records are unrelated.
Examples
Rule 1. You can't delete any of the rows in the CarType table that are visible in the picture since all the car
types are in use in the Car table.
Rule 2. You can't change any of the model_ids in the CarType table since all the car types are in use in the
Car table.
Rule 3. The values that you can enter in the model_id field in the Car table must be in the model_id field in the
CarType table.
Rule 4. The model_id field in the Car table can have a null value which means that the car type of that car in
not known
Foreign Key Integrity
Constraint
• There are two foreign key integrity constraints: cascade update related fields and cascade delete related rows.
These constraints affect the referential integrity constraint.
Cascade Update Related Fields
Any time you change the primary key of a row in the primary table, the foreign key values are updated in the
matching rows in the related table. This constraint overrules rule 2 in the referential integrity constraints.
If this contraint is defined in the relationship between the tables Car and CarType, it is possible to change the
model_id in the CarType table. If one should change the model_id 1 (Ford Focus) to model_id 100 in the
CarType table, the model_ids in the Car table would change from 1 to 100 (cars ABC-112, ABC-122, ABC-
123).
Cascade Delete Related Rows
Any time you delete a row in the primary table, the matching rows are automatically deleted in the related
table. This constraint overrules rule 1 in the referential integrity constraints.
If this contraint is defined in the relationship between the tables Car and CarType, it is possible to delete rows
from the CarType table. If one should delete the Ford Focus row from the CarType table, the cars
ABC-112, ABC-122, ABC-123 would be deleted from the Car table, too. Source: Gillette Cynthia. 2001. MSCE
SQL 2000 Database Design. Chapter 2: Data Modelling. Coriolis Group.
THNAK YOU

More Related Content

What's hot

Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management SystemAjay Jha
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
Difference between star schema and snowflake schema
Difference between star schema and snowflake schemaDifference between star schema and snowflake schema
Difference between star schema and snowflake schemaUmar Ali
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
chapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdfchapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdfMisganawAbeje1
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databasesJames Serra
 
Client server architecture
Client server architectureClient server architecture
Client server architectureRituBhargava7
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and designDabbal Singh Mahara
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
Dbms schema & instance
Dbms schema & instanceDbms schema & instance
Dbms schema & instancePapan Sarkar
 
Dm from databases perspective u 1
Dm from databases perspective u 1Dm from databases perspective u 1
Dm from databases perspective u 1sakthyvel3
 
Advance database system(part 4)
Advance database system(part 4)Advance database system(part 4)
Advance database system(part 4)Abdullah Khosa
 

What's hot (20)

Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Difference between star schema and snowflake schema
Difference between star schema and snowflake schemaDifference between star schema and snowflake schema
Difference between star schema and snowflake schema
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
chapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdfchapter 1-Introduction Fundamentals of database system.pdf
chapter 1-Introduction Fundamentals of database system.pdf
 
Relational databases vs Non-relational databases
Relational databases vs Non-relational databasesRelational databases vs Non-relational databases
Relational databases vs Non-relational databases
 
Lecture 1 ddbms
Lecture 1 ddbmsLecture 1 ddbms
Lecture 1 ddbms
 
Client server architecture
Client server architectureClient server architecture
Client server architecture
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Dbms schema & instance
Dbms schema & instanceDbms schema & instance
Dbms schema & instance
 
Dm from databases perspective u 1
Dm from databases perspective u 1Dm from databases perspective u 1
Dm from databases perspective u 1
 
Data models
Data modelsData models
Data models
 
Rdbms
RdbmsRdbms
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
 
Advance database system(part 4)
Advance database system(part 4)Advance database system(part 4)
Advance database system(part 4)
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
 
Distributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - IntroductionDistributed DBMS - Unit 1 - Introduction
Distributed DBMS - Unit 1 - Introduction
 

Viewers also liked

Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraintsmadhav bansal
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraintsVivek Singh
 
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
 
Sql ch 9 - data integrity
Sql ch 9 - data integritySql ch 9 - data integrity
Sql ch 9 - data integrityMukesh Tekwani
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database componentprudhvivreddy
 
Digital Menu Boards Guide 2014
Digital Menu Boards Guide 2014 Digital Menu Boards Guide 2014
Digital Menu Boards Guide 2014 Drew Harding
 
SQL Server - Constraints
SQL Server - ConstraintsSQL Server - Constraints
SQL Server - ConstraintsAaron Buma
 
Slide 6 er strong & weak entity
Slide 6 er  strong & weak entitySlide 6 er  strong & weak entity
Slide 6 er strong & weak entityVisakh V
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationshipswmassie
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Engr Imran Ashraf
 
Data integrity
Data integrityData integrity
Data integrityKiran Kota
 
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...Rohan Byanjankar
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemEddyzulham Mahluzydde
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System IntroductionSmriti Jain
 
Presentation on data integrity in Pharmaceutical Industry
Presentation on data integrity in Pharmaceutical IndustryPresentation on data integrity in Pharmaceutical Industry
Presentation on data integrity in Pharmaceutical IndustrySathish Vemula
 

Viewers also liked (17)

Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Data integrity
Data integrityData integrity
Data integrity
 
Sql integrity constraints
Sql integrity constraintsSql integrity constraints
Sql integrity constraints
 
Sql server ___________session_15(data integrity)
Sql server  ___________session_15(data integrity)Sql server  ___________session_15(data integrity)
Sql server ___________session_15(data integrity)
 
Sql ch 9 - data integrity
Sql ch 9 - data integritySql ch 9 - data integrity
Sql ch 9 - data integrity
 
Basic example using database component
Basic example using database componentBasic example using database component
Basic example using database component
 
Digital Menu Boards Guide 2014
Digital Menu Boards Guide 2014 Digital Menu Boards Guide 2014
Digital Menu Boards Guide 2014
 
Database & dbms
Database & dbmsDatabase & dbms
Database & dbms
 
SQL Server - Constraints
SQL Server - ConstraintsSQL Server - Constraints
SQL Server - Constraints
 
Slide 6 er strong & weak entity
Slide 6 er  strong & weak entitySlide 6 er  strong & weak entity
Slide 6 er strong & weak entity
 
Database Relationships
Database RelationshipsDatabase Relationships
Database Relationships
 
Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18Data integrity Dbms presentation 12 cs 18
Data integrity Dbms presentation 12 cs 18
 
Data integrity
Data integrityData integrity
Data integrity
 
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...
Concept of Relational Database and Integrity Constraints [DIFFERENCE BETWEEN ...
 
Chapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management SystemChapter 1 Fundamentals of Database Management System
Chapter 1 Fundamentals of Database Management System
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
Presentation on data integrity in Pharmaceutical Industry
Presentation on data integrity in Pharmaceutical IndustryPresentation on data integrity in Pharmaceutical Industry
Presentation on data integrity in Pharmaceutical Industry
 

Similar to integrity constraints

5. relational structure
5. relational structure5. relational structure
5. relational structurekhoahuy82
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal waghharshalkwagh999
 
Relational Model and Relational Algebra.pptx
Relational Model and Relational Algebra.pptxRelational Model and Relational Algebra.pptx
Relational Model and Relational Algebra.pptxKoteswari Kasireddy
 
DBMS Integrity rule
DBMS Integrity ruleDBMS Integrity rule
DBMS Integrity ruleGirdharRatne
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)Abdullah Khosa
 
Joins & constraints
Joins & constraintsJoins & constraints
Joins & constraintsVENNILAV6
 
Relational database (Unit 2)
Relational database (Unit 2)Relational database (Unit 2)
Relational database (Unit 2)Ismail Mukiibi
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In SqlAnurag
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelKunal Anand
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMSkoolkampus
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Techglyphs
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answersLakshmiSarvani6
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptxkavitha623544
 
Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptxHaso12
 

Similar to integrity constraints (20)

5. relational structure
5. relational structure5. relational structure
5. relational structure
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
Relational Model and Relational Algebra.pptx
Relational Model and Relational Algebra.pptxRelational Model and Relational Algebra.pptx
Relational Model and Relational Algebra.pptx
 
unit-3_Chapter1_RDRA.pdf
unit-3_Chapter1_RDRA.pdfunit-3_Chapter1_RDRA.pdf
unit-3_Chapter1_RDRA.pdf
 
DBMS Integrity rule
DBMS Integrity ruleDBMS Integrity rule
DBMS Integrity rule
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)
 
Joins & constraints
Joins & constraintsJoins & constraints
Joins & constraints
 
Relational database (Unit 2)
Relational database (Unit 2)Relational database (Unit 2)
Relational database (Unit 2)
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Chapter-5 The Relational Data Model
Chapter-5 The Relational Data ModelChapter-5 The Relational Data Model
Chapter-5 The Relational Data Model
 
Integrity and security
Integrity and securityIntegrity and security
Integrity and security
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Oracle SQL Advanced
Oracle SQL AdvancedOracle SQL Advanced
Oracle SQL Advanced
 
6. Integrity and Security in DBMS
6. Integrity and Security in DBMS6. Integrity and Security in DBMS
6. Integrity and Security in DBMS
 
Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2Bt0075 rdbms with mysql 2
Bt0075 rdbms with mysql 2
 
Dbms important questions and answers
Dbms important questions and answersDbms important questions and answers
Dbms important questions and answers
 
Pre-sentation.pdf
Pre-sentation.pdfPre-sentation.pdf
Pre-sentation.pdf
 
5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx5th chapter Relational algebra.pptx
5th chapter Relational algebra.pptx
 
Relational data model
Relational data modelRelational data model
Relational data model
 
Module 4_PART1.pptx
Module 4_PART1.pptxModule 4_PART1.pptx
Module 4_PART1.pptx
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 

integrity constraints

  • 3. Different types of integrity • There are the domain integrity, • the entity integrity, t • he referential integrity and • the foreign key integrity constraints.
  • 5. Domain Integrity • Domain integrity means the definition of a valid set of values for an attribute. You define - data type, - lenght or size - is null value allowed - is the value unique or not for an attribute. You may also define the default value, the range (values in between) and/or specific values for the attribute. Some DBMS allow you to define the output format and/or input mask for the attribute. These definitions ensure that a specific attribute will have a right and proper value in the database.
  • 6. Entity Integrity Constraint • The entity integrity constraint states that primary keys can't be null. There must be a proper value in the primary key field. This is because the primary key value is used to identify individual rows in a table. If there were null values for primary keys, it would mean that we could not indentify those rows. On the other hand, there can be null values other than primary key fields. Null value means that one doesn't know the value for that field. Null value is different from zero value or space. In the Car Rental database in the Car table each car must have a proper and unique Reg_No. There might be a car whose rate is unknown - maybe the car is broken or it is brand new - i.e. the Rate field has a null value. See the picture below. The entity integrity constraints assure that a spesific row in a table can be identified. • Picture. Car and CarType tables in the Rent database
  • 7. Referential Integrity Constraint • The referential integrity constraint is specified between two tables and it is used to maintain the consistency among rows between the two tables. The rules are: 1. You can't delete a record from a primary table if matching records exist in a related table. 2. You can't change a primary key value in the primary table if that record has related records. 3. You can't enter a value in the foreign key field of the related table that doesn't exist in the primary key of the primary table. 4. However, you can enter a Null value in the foreign key, specifying that the records are unrelated. Examples Rule 1. You can't delete any of the rows in the CarType table that are visible in the picture since all the car types are in use in the Car table. Rule 2. You can't change any of the model_ids in the CarType table since all the car types are in use in the Car table. Rule 3. The values that you can enter in the model_id field in the Car table must be in the model_id field in the CarType table. Rule 4. The model_id field in the Car table can have a null value which means that the car type of that car in not known
  • 8. Foreign Key Integrity Constraint • There are two foreign key integrity constraints: cascade update related fields and cascade delete related rows. These constraints affect the referential integrity constraint. Cascade Update Related Fields Any time you change the primary key of a row in the primary table, the foreign key values are updated in the matching rows in the related table. This constraint overrules rule 2 in the referential integrity constraints. If this contraint is defined in the relationship between the tables Car and CarType, it is possible to change the model_id in the CarType table. If one should change the model_id 1 (Ford Focus) to model_id 100 in the CarType table, the model_ids in the Car table would change from 1 to 100 (cars ABC-112, ABC-122, ABC- 123). Cascade Delete Related Rows Any time you delete a row in the primary table, the matching rows are automatically deleted in the related table. This constraint overrules rule 1 in the referential integrity constraints. If this contraint is defined in the relationship between the tables Car and CarType, it is possible to delete rows from the CarType table. If one should delete the Ford Focus row from the CarType table, the cars ABC-112, ABC-122, ABC-123 would be deleted from the Car table, too. Source: Gillette Cynthia. 2001. MSCE SQL 2000 Database Design. Chapter 2: Data Modelling. Coriolis Group.
  • 9.