CONSTRAINTS
SQL> create table stu1(regno varchar(9),
2 name char(9) not null,
3 eno number(2) unique,
4 dep char(2) default 'it',
5 mark number(9) check (mark>=40),
6 constraint pk primary key (regno));
Table created.
SQL> insert into stu1 values(®no,&name,&eno,&dep,&mark);
Enter value for regno: '01'
Enter value for name: ''
Enter value for eno: 001
Enter value for dep: 'cs'
Enter value for mark: 50
old 1: insert into stu1 values(®no,&name,&eno,&dep,&mark)
new 1: insert into stu1 values('01','',001,'cs',50)
insert into stu1 values('01','',001,'cs',50)
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SYSTEM"."STU1"."NAME")
SQL> insert into stu1 values(®no,&name,&eno,&dep,&mark);
Enter value for regno: '01'
Enter value for name: 'ashok'
Enter value for eno: 001
Enter value for dep: 'cs'
Enter value for mark: 50
old 1: insert into stu1 values(®no,&name,&eno,&dep,&mark)
new 1: insert into stu1 values('01','ashok',001,'cs',50)
1 row created.
SQL> select * from stu1;
REGNO NAME ENO DE MARK
--------- --------- ---------- -- ----------
01 ashok 1 cs 50