SQL> set pagesize 60 SQL> set linesize 140 SQL> insert into enrollments 2 values ('66419', '9876', '','A'); insert into enrollments * ERROR at line 1: ORA-02291: integrity constraint (CSC240R.ENRLSTUD) violated - parent key not found SQL> insert into enrollments 2 values ('66419', '1011', '','A'); 1 row created. SQL> select * from enrollments where sectionid = 66419; SECTI STUD SPECIALP GR ----- ---- -------- -- 66419 1093 D 66419 1111 C 66419 1115 F 66419 1116 B 66419 1119 C 66419 1011 A 66419 2121 7 rows selected. SQL> commit; Commit complete. SQL> insert into enrollments (studentid, sectionid, grade) 2 values ('7070',66419,'A'); 1 row created. SQL> insert into enrollments (studentid, sectionid, grade) 2 values (7171,66419,'B'), 3 (5555,66419,'C'); values (7171,66419,'B'), * ERROR at line 2: ORA-00933: SQL command not properly ended SQL> insert into students (studentid, first, last, year) 2 values (1093,'James','Johnson','Fr'); insert into students (studentid, first, last, year) * ERROR at line 1: ORA-00001: unique constraint (CSC240R.STDPK) violated SQL> select * from enrollments where sectionid = 66419; SECTI STUD SPECIALP GR ----- ---- -------- -- 66419 1093 D 66419 1111 C 66419 1115 F 66419 1116 B 66419 1119 C 66419 1011 A 66419 7070 A 66419 2121 8 rows selected. SQL> rollback 2 ; Rollback complete. SQL> select * from enrollments where sectionid = 66419; SECTI STUD SPECIALP GR ----- ---- -------- -- 66419 1093 D 66419 1111 C 66419 1115 F 66419 1116 B 66419 1119 C 66419 1011 A 66419 2121 7 rows selected. SQL> insert into dept_info (dname,num_classes,max_enroll) 2 select dept, count(*), max(stoppoint) 3 from sections 4 group by dept; 17 rows created. SQL> select * from dept_info; DNAM NUM_CLASSES MAX_ENROLL ---- ----------- ---------- HIS 16 25 BUS 7 25 CSIT 11 35 MTH 22 25 PHL 2 25 POL 2 25 ENG 18 25 CHEM 9 99 SOC 2 25 BIO 4 25 MGMT 15 25 REL 4 25 CSD 3 20 CSC 27 35 MKTG 6 25 ECN 12 25 PSY 4 25 HIS 16 25 BUS 7 25 CSIT 11 35 MTH 22 25 PHL 2 25 POL 2 25 ENG 18 25 CHEM 9 99 SOC 2 25 BIO 4 25 MGMT 15 25 REL 4 25 CSD 3 20 CSC 27 35 MKTG 6 25 ECN 12 25 PSY 4 25 34 rows selected. SQL> select * from dept_info; DNAM NUM_CLASSES MAX_ENROLL ---- ----------- ---------- HIS 16 25 BUS 7 25 CSIT 11 35 MTH 22 25 PHL 2 25 POL 2 25 ENG 18 25 CHEM 9 99 SOC 2 25 BIO 4 25 MGMT 15 25 REL 4 25 CSD 3 20 CSC 27 35 MKTG 6 25 ECN 12 25 PSY 4 25 17 rows selected. SQL> commit; Commit complete. SQL> DELETE 2 from students 3 where studentid = '1234'; 1 row deleted. SQL> commit; Commit complete. SQL> DELETE from students 2 where gpa < 2.5; 3 rows deleted. SQL> select * from students; STUD FIRST M LAST YE MAJO NUMCREDITSEARNED GPA HOMETOWN BALANCEDUE ---- --------------- - --------------- -- ---- ---------------- ---------- -------------------- ---------- 1011 Ason J Kidd So MGMT 40 3.1 Oakland 0 1093 Chris T Webber So CSC 45 3.51 Haddonfield 2500 1111 Charles D Barkley Fr HIS 22 3 Pennsauken 0 1113 Kenny T Anderson So MGMT 54 2.85 Camden 1000 1115 Shaq O O'Neal Jr MKTG 94 3.82 Vorhees 0 1116 Allen X Iverson Jr BIO 81 2.87 Maple Shade 3500 1117 Grant P Hill Sr CSC 107 3.87 Pennsauken 0 1119 Marcus S Camby So CHEM 48 3.21 Pennsauken 50 1212 Kobe J Bryant So BIO 31 2.67 Lower Merion 125 2121 Keith V Van Horn Sr MGMT 91 2.98 Cherry Hill 100 2222 Larry R Hughes So BIO 13 3.1 Philadelphia 0 3131 Shane D Battier Fr CHEM 15 3.85 Vorhees 0 4141 Glenn B Robinson Jr HIS 70 2.5 Philadelphia 120 5151 Baron U Davis So BIO 32 2.99 Westwood 0 6161 Michael S Jordan Sr MKTG 110 3.65 Wilmington 0 7070 Tim D Duncan Sr HIS 99 3.87 San Antonio 10 7171 Paul P Pierce So CHEM 35 3.1 Boston 100 17 rows selected. SQL> rollback 2 ; Rollback complete. SQL> select * from students; STUD FIRST M LAST YE MAJO NUMCREDITSEARNED GPA HOMETOWN BALANCEDUE ---- --------------- - --------------- -- ---- ---------------- ---------- -------------------- ---------- 1011 Ason J Kidd So MGMT 40 3.1 Oakland 0 1093 Chris T Webber So CSC 45 3.51 Haddonfield 2500 1111 Charles D Barkley Fr HIS 22 3 Pennsauken 0 1113 Kenny T Anderson So MGMT 54 2.85 Camden 1000 1115 Shaq O O'Neal Jr MKTG 94 3.82 Vorhees 0 1116 Allen X Iverson Jr BIO 81 2.87 Maple Shade 3500 1117 Grant P Hill Sr CSC 107 3.87 Pennsauken 0 1119 Marcus S Camby So CHEM 48 3.21 Pennsauken 50 1123 Shawn W Bradley Fr CSC 27 2.12 Palmyra 1500 1212 Kobe J Bryant So BIO 31 2.67 Lower Merion 125 1818 Kevin G Garnett Fr BIO 12 1.9 Chicago 0 2121 Keith V Van Horn Sr MGMT 91 2.98 Cherry Hill 100 2222 Larry R Hughes So BIO 13 3.1 Philadelphia 0 3131 Shane D Battier Fr CHEM 15 3.85 Vorhees 0 4141 Glenn B Robinson Jr HIS 70 2.5 Philadelphia 120 5151 Baron U Davis So BIO 32 2.99 Westwood 0 5555 Penny A Hardaway Fr CSC 12 2.31 Cherry Hill 0 6161 Michael S Jordan Sr MKTG 110 3.65 Wilmington 0 7070 Tim D Duncan Sr HIS 99 3.87 San Antonio 10 7171 Paul P Pierce So CHEM 35 3.1 Boston 100 20 rows selected. SQL> DELETE from students, enrollments 2 WHERE studentid = '1011'; DELETE from students, enrollments * ERROR at line 1: ORA-00933: SQL command not properly ended SQL> DELETE from students 2 WHERE studentid = '1011'; 1 row deleted. SQL> select * from enrollments where sectionid = 66419; SECTI STUD SPECIALP GR ----- ---- -------- -- 66419 1093 D 66419 1111 C 66419 1115 F 66419 1116 B 66419 1119 C 66419 2121 6 rows selected. SQL> rollback; Rollback complete. SQL> delete from students; 20 rows deleted. SQL> rollback 2 ; Rollback complete. SQL> spool off