1 Table Creation
1 Table Creation
1 Table Creation
Providing name to the constraint is optional. If user does not provide name then
Oracle will give an auto name.
Table Level Constraints. – The constraints are defined after the columns.
Any column level constraint can also be defined at the table level. Exception is
only for Not Null constraint.
Duplicating a table
DML Statements
Insert statement
-- One complete record
Insert into emp
values(1111,'one','ANALYST',7902,'1-jan-1911',10000,null,10);
Default Values:
Output:
2 Denmark
2000
Delete statement
Update statement
When records are present in the parent and the child tables then by
default the records from the parent tables cannot be deleted if the
dependency exists in the child tables.
select * from result1; -- In the child table the rollno has become null
But cascade clause can be added which will first drops the foreign
keys from the child table.
SQL> create table student (rollno number primary key, name varchar2(20),
cell_no number);
Table created.
Table created.
Table dropped.