Sunteți pe pagina 1din 16

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : M. Bhagya Lakshmi
Designation : Lecturer in CCP
Branch : DCCP
Institute : GMR Polytechnic, Gajwel
Year/Semester : V Semester
Subject : RDBMS
Subject Code : CCP505
Topic : SQL Plus
Duration : 50 Mts
Sub Topic : DATA CONSTRAINTS
Teaching aids : PPT and Animations
CCP505.51 1
Objectives :

On completion of the period, you would be


able to know:
 Overview of SQL
 Introduction of integrity constraints
 Domain integrity constraints

CCP505.51 2
Recap :

Overview of SQL:

 The SQL language is subdivided according to


their functions as follows
 Data definition language (DDL)
 Data manipulation language (DML)
 Data control language (DCL)

CCP505.51 3
What are DDL Commands :

DDL commands:

 Create table command


 Alter table command
 Truncate table command
 Drop table command

CCP505.51 4
What are the Various DML
Commands :

DML commands:

 Insert
 Select
 Update
 Delete

CCP505.51 5
List Out DCL Commands :

The DCL commands:

 Commit
 Savepoint
 Rollback
 GRANT privileges
 REVOKE privileges

CCP505.51 6
Know to Unknown :

 With CREATE & INSERT a table is created


and data is entered
 With other SQL commands the data base
management will be done
 Why integrity constraints?
 To maintain the integrity of data

CCP505.51 7
Integrity Constraints :

Introduction to integrity constraints:

 Maintaining security and integrity of a database


is the most important factor in judging the
success of a system
 This integrity can be applied to different degrees
of severity

CCP505.51 8
Introduction to integrity constraints:

 An integrity constraint is a mechanism used by


oracle to prevent invalid data entry into the
table
 In other words constraints are used for enforcing
rules that the columns in a table have to
conform with

CCP505.51 9
Types of Integrity Constraints :

The following are the various types of


integrity constraints

 Domain integrity constraints


 Entity integrity constraints
 Referential integrity constraints

CCP505.51 10
Domain Integrity Constraints :

 These constraints set a range, and any


violations that take place will prevent the user
from performing the manipulation that caused
the breach
 There are basically two types of domain integrity
constraints
 Not Null constraint
 Check constraint

CCP505.51 11
Not Null Constraint :

 What is null ?
 By default the tables can contain null values
 The enforcement of not null constraints in a
table ensures that the table contains values
 Oracle will not validate the record until this is
satisfied

CCP505.51 12
Check Constraint :

 Check means
 The other type of constraint available under this
classification is the ‘check’ constraint
 This can be defined to allow only a particular
range of values
 When the demarcation specified in this range
is violated oracle rejects the record

CCP505.51 13
Summary :

We have discussed about

 Overview of SQL
 Introduction of integrity constraints
 Domain integrity constraints

CCP505.51 14
Quiz :

1. The various types of integrity constraints are


a) Domain integrity constraints
b) Entity integrity constraints
c) Referential integrity constraints
d) All

CCP505.51 15
Frequently Asked Questions :

1. Explain why integrity constraints are necessary


in SQL.
2. List out the various types of integrity
constraints.
3. Explain Domain integrity constraints.

CCP505.51 16

S-ar putea să vă placă și