Constraints
Constraints
CONSTRAINTS
---------------
/ \
SQL PL/SQL
CONSTRAINTS TRIGGERS
These are
1. Not null
2. Unique
3. Primary key
4. Foreign key
5. Check
6. Default
null values.
--------------------------------------------------------------------------
the outputs.
CREATE TABLE STUDENT1(SID CHAR(1) NOT NULL UNIQUE, SNAME VARCHAR2(10) not null,M1
NUMBER CHECK(M1 BTWEEN 0 AND 100));
--------------------------------------------------------------------------
conditions.
the outputs.
IF YOU WANT TO MODIFY THE DATA TYPE IN CONSTRINAT TABLE THEN DIRECT YOU CANT SO THE
SYNTAX TO MODIFY THE DATA TYPE IS SQL> ALTER TABLE EMPLOYEE DROP CONSTRAINT
SYS_C008329;
conditions.
the outputs.
GENDER Must be M or F
--------------------------------------------------------------------------
6.Default
=========
.if we pass the value,it takes that value.if we dont pass the value
the outputs.
SID PK
SNAME NOTNULL
----------------------------------------------------------------------------------
the outputs.
COURSE STUDENT
======= ========
PK pk FK
--------------------------------------------------------------------------
conditions.
the outputs.
-----------------------------------------------------------------------------------
7.Establish the relation b/w DOCTORS and PATIENTS table by using
DOCTORS PATIENTS
======= ==========
PK PK FK
-----------------------------------------------------------------------------------
is enough.
------------------------------------------------------------------------------------