0% found this document useful (0 votes)
13 views3 pages

L 3 Without Errors

Uploaded by

powekac319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

L 3 Without Errors

Uploaded by

powekac319
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

INSERT INTO DEPT1 VALUES ('D1', 'Marketing', 'CHN', 500000);

INSERT INTO DEPT1 VALUES ('D2', 'Research', 'MNG', 300000);


INSERT INTO DEPT1 VALUES ('D3', 'IT', 'BNG', 400000);
INSERT INTO DEPT1 VALUES ('D4', 'HR', 'BNG', 200000);
INSERT INTO DEPT1 VALUES ('D5', 'Accounts', 'BNG', 500000);
INSERT INTO DEPT1 VALUES (NULL, 'Corporate', 'HYD', 700000);

INSERT INTO DEPT1 VALUES ('D6', 'Sales', 'MUB', 300000);


INSERT INTO DEPT1 VALUES ('D8', 'QA', 'CHN', 400000);

INSERT INTO PROJ VALUES ('D1', 'P1', 'RiverWatch', 4, to_date('01-03-2024', 'dd-mm-


yyyy'), to_date('01-09-2024', 'dd-mm-yyyy'), 400000);
INSERT INTO PROJ VALUES ('D2', 'P1', 'UniViewer', 2, to_date('01-03-2024', 'dd-mm-
yyyy'), to_date('01-08-2024', 'dd-mm-yyyy'), 200000);
INSERT INTO PROJ VALUES ('D3', 'P2', 'PetsParty', 3, to_date('01-08-2024', 'dd-mm-
yyyy'), to_date('01-12-2024', 'dd-mm-yyyy'), 300000);
INSERT INTO PROJ VALUES ('D1', 'P3', 'NeoGraph', 5, to_date('01-07-2024', 'dd-mm-
yyyy'), to_date('01-11-2024', 'dd-mm-yyyy'), 500000);
INSERT INTO PROJ VALUES ('D4', 'P2', 'FoodYolo', 7, to_date('01-07-2024', 'dd-mm-
yyyy'), to_date('01-12-2024', 'dd-mm-yyyy'), 700000);

INSERT INTO PROJ VALUES ('D6', 'P4', 'StockRise', 7, to_date('01-11-2024', 'dd-mm-


yyyy'), to_date('01-03-2025', 'dd-mm-yyyy'), 700000);
INSERT INTO PROJ VALUES ('D8', 'P4', 'Healify', 2, to_date('01-11-2024', 'dd-mm-
yyyy'), to_date('01-03-2025', 'dd-mm-yyyy'), 800000);

INSERT INTO task VALUES(1, 'Design Phase', 'P1', 'D1', to_date('01-04-2024', 'dd-
mm-yyyy'), to_date('01-05-2024', 'dd-mm-yyyy'), 'COMPLETED');
INSERT INTO task VALUES (2, 'Development Phase', 'P1', 'D2',to_date('01-05-2024',
'dd-mm-yyyy'), to_date('01-08-2024','dd-mm-yyyy'), 'COMPLETED');
INSERT INTO task VALUES (1, 'Design Phase', 'P2', 'D3',to_date('01-08-2024', 'dd-
mm-yyyy'), to_date('01-09-2024','dd-mm-yyyy'), 'IN PROGRESS');
INSERT INTO task VALUES (2, 'Development Phase', 'P3', 'D1', to_date('01-09-2024',
'dd-mm-yyyy'), to_date('01-11-2024','dd-mm-yyyy'), 'IN PROGRESS');
INSERT INTO task VALUES (3, 'Testing Phase', 'P3', 'D1',to_date('01-07-2024', 'dd-
mm-yyyy'), to_date('01-08-2024','dd-mm-yyyy'), 'COMPLETED');

INSERT INTO task VALUES (4, 'Development Phase', 'P4', 'D6',to_date('01-11-2024',


'dd-mm-yyyy'), to_date('03-11-2024', 'dd-mm-yyyy'), 'NOT STARTED');
INSERT INTO task VALUES (4, 'Launch Phase', 'P4', 'D8',to_date('01-12-2024', 'dd-
mm-yyyy'), to_date('05-12-2024', 'dd-mm-yyyy'), 'NOT STARTED');

Insert Into EMP Values(101, 'Ravi', 'MGR',NULL, to_date('10-10-1985', 'dd-mm-


yyyy'), 32000, 15000, 'D1', to_date('02-10-2001', 'dd-mm-yyyy'), 'P1');
Insert Into EMP Values(102, 'Raviraj', 'CLRK', NULL, to_date('10-12-1980', 'dd-mm-
yyyy'), 24000, 12000, 'D1', to_date('12-11-2000', 'dd-mm-yyyy'), 'P3');
Insert Into EMP Values(111, 'Raghu', 'GM', NULL, to_date('10-12-1974', 'dd-mm-
yyyy'), 45000, 15000, null, to_date('03-12-1990', 'dd-mm-yyyy'), null);
Insert Into EMP Values(150, 'Oswald', 'CEO', NULL, to_date('10-12-1970', 'dd-mm-
yyyy'), 60000, 30000, null, to_date('03-12-1990', 'dd-mm-yyyy'), null);
Insert Into EMP Values(103, 'Jason', 'CLRK', NULL, to_date('02-10-1980', 'dd-mm-
yyyy'), 30000, 20000, 'D1', to_date('02-10-2001', 'dd-mm-yyyy'), 'P1');
Insert Into EMP Values(105, 'Jacob', 'CLRK', NULL, to_date('10-12-1980', 'dd-mm-
yyyy'), 25000, 5000, 'D1', to_date('02-10-2002', 'dd-mm-yyyy'), 'P3');
Insert Into EMP Values(125, 'Manu', 'A.MGR', NULL, to_date('10-10-1980', 'dd-mm-
yyyy'),37000, 10000, 'D4', to_date('02-10-2002', 'dd-mm-yyyy'), 'P2');
Insert Into EMP Values(104, 'Neil', 'CLRK', NULL, to_date('02-10-1980', 'dd-mm-
yyyy'), 42000, 13000, 'D2', to_date('02-10-2005', 'dd-mm-yyyy'), 'P1');

INSERT INTO PROJ VALUES ('D2', 'P3', 'JoinStock', 7, to_date('01-07-2024', 'dd-mm-


yyyy'), to_date('01-12-2024', 'dd-mm-yyyy'), 700000);
Insert Into EMP Values(106, 'Veron', 'MGR', NULL, to_date('02-10-1986', 'dd-mm-
yyyy'), 45000, 15000, 'D2', to_date('02-10-1987', 'dd-mm-yyyy'), 'P1');

Insert Into EMP Values(123, 'Mahesh', 'CLRK', NULL,to_date('10-12-1974', 'dd-mm-


yyyy'), 25000, 24000, 'D3', to_date('02-10-2002', 'dd-mm-yyyy'), 'P2');

INSERT INTO DEPT1 VALUES ('D9', 'UX', 'MUB', 300000);


INSERT INTO PROJ VALUES ('D9', 'P1', 'Umbrail', 7, to_date('01-06-2024', 'dd-mm-
yyyy'), to_date('01-12-2024', 'dd-mm-yyyy'), 700000);
Insert Into EMP Values(108, 'Jeffry', 'CLRK', NULL,to_date('10-12-1970', 'dd-mm-
yyyy'), 41000, 25000, 'D9', to_date('02-10-1985', 'dd-mm-yyyy'), 'P1');

Insert Into EMP Values(107, 'Jarrod', 'CLRK', NULL,to_date('10-12-1980', 'dd-mm-


yyyy'), 38000, 30000, 'D1', to_date('02-10-2001', 'dd-mm-yyyy'), 'P3');

Insert Into EMP Values(109, 'Shreya', 'CLRK', NULL,to_date('10-12-1980', 'dd-mm-


yyyy'), 21000, 10000, 'D4', to_date('10-12-1996', 'dd-mm-yyyy'), 'P2');

Update emp set mgrid=111 where empno=101;


Update emp set mgrid=106 where empno=102;
Update emp set mgrid=150 where empno=111;
Update emp set mgrid=111 where empno=103;
Update emp set mgrid=111 where empno=105;
Update emp set mgrid=150 where empno=125;
Update emp set mgrid=125 where empno=104;
Update emp set mgrid=111 where empno=106;
Update emp set mgrid=150 where empno=123;
Update emp set mgrid=106 where empno=108;
Update emp set mgrid=111 where empno=103;
Update emp set mgrid=106 where empno=109;

Insert Into EMP Values(112, 'Ravirj', 'MGR', '150',to_date('10-12-1986', 'dd-mm-


yyyy'), 50000, null, 'D6', to_date('10-12-2000', 'dd-mm-yyyy'),'P4');
Insert Into EMP Values(113, 'Deion', 'CLRK', '111',to_date('10-12-1990', 'dd-mm-
yyyy'), 37000, 0, 'D8', to_date('10-12-2000', 'dd-mm-yyyy'), 'P4');

Commit;
Delete from emp where prj_id='P3';
Rollback;
Commit;
Delete from dept1 where dname='Accounts';
Rollback;

Commit;
Delete from emp where empno=125 and prj_id='P2';
rollback;

Commit;
Delete from task where prj_id='P2';
Rollback;

Update proj set dno='D5' WHERE ROWNUM = 1;


//Error
ORA-02292: integrity constraint (MCA088.SYS_C0097437) violated - child record found

Update emp set job='MGR', sal=35000, MGrID='111' where empno=123;

Update emp set comm=10000 where job='MGR';

Alter table emp modify comm DEFAULT 10000;

You might also like