19mis0367 DBMS Lab
19mis0367 DBMS Lab
19mis0367 DBMS Lab
REG.NO: 19MIS0367
department(dept_id: integer,dept_name:string)
DOJ: date)
use db_emp_pay_scenerio;
varchar(50));
varchar(50));
department(dept_id),basic int(7),deductions
employee(emp_id),pay_date date);
insert into employee values(101,"Aman");
values(101,1,0101,500,500,"1998-08-05");
values(102,2,600,200,700,"1998-08-05");
values(103,3,900,700,900,"1999-04-06");
1 row created.
SQL> //
Enter value for emp_id: 2894
Enter value for dept_id: 5
Enter value for basic: 14000
Enter value for deductions: 23.98
Enter value for additions: 40.09
Enter value for doj: 01-jan-96
old 1: insert into paydetails
values('&emp_id','&dept_id','&basic','&deductions','&additions','&doj')
new 1: insert into paydetails values('2894','5','14000','23.98','40.09','01-jan-96')
1 row created.
SQL> //
Enter value for emp_id: 8793
Enter value for dept_id: 9
Enter value for basic: 9000
Enter value for deductions: 30.54
Enter value for additions: 40.09
Enter value for doj: 06-jul-97
old 1: insert into paydetails
values('&emp_id','&dept_id','&basic','&deductions','&additions','&doj')
new 1: insert into paydetails values('8793','9','9000','30.54','40.09','06-jul-97')
1 row created.
SQL> //
Enter value for emp_id: 0005
Enter value for dept_id: 8
Enter value for basic: 17000
Enter value for deductions: 32.78
Enter value for additions: 65.09
Enter value for doj: 08-aug-97
old 1: insert into paydetails
values('&emp_id','&dept_id','&basic','&deductions','&additions','&doj')
new 1: insert into paydetails values('0005','8','17000','32.78','65.09','08-aug-97')
1 row created.
1 row created.
SQL> //
Enter value for emp_id: 2874
Enter value for date: 28-oct-20
old 1: insert into payroll values('&emp_id','&date')
new 1: insert into payroll values('2874','28-oct-20')
insert into payroll values('2874','28-oct-20')
*
ERROR at line 1:
ORA-02291: integrity constraint (SYSTEM.SYS_C007409) violated - parent key not
found
SQL> //
Enter value for emp_id: 0005
Enter value for date: 30-oct-20
old 1: insert into payroll values('&emp_id','&date')
new 1: insert into payroll values('0005','30-oct-20')
1 row created.
SQL> //
Enter value for emp_id: 2894
Enter value for date: 30-oct-20
old 1: insert into payroll values('&emp_id','&date')
new 1: insert into payroll values('2894','30-oct-20')
1 row created.
SQL> //
Enter value for emp_id: 8793
Enter value for date: 30-oct-20
old 1: insert into payroll values('&emp_id','&date')
new 1: insert into payroll values('8793','30-oct-20')
1 row created.