Question: create the following tables and insert all test records. Make sure you have set 1. Create a echo on in the beginning of the file.


create the following tables and insert all test records. Make sure you have set 1. Create a echo on in the beginning of the file. Spo print out of the create.txt file file cre ol your output to create.txt. Run create.sql until there is no error. Turn in a Students SNum 101 102 103 Enrollments SNum CNum Grade 101 101 102 Courses CNum IS380 IS385 Systems IS355 Instr Lee Smith Sname Andy Betty Cindy IS Major IS FIN GPA 3.2 Database IS380 IS385 IS380 A IS355 B Telecomm Lee 3.8 Field definitions SNum varchar2(3) SName varchar2(25) Major varchar2(20) GPA Number(3,2) CNum varchar2(8) Grade varchar2(1) CTite varchar(25) Instr varchar2 (25) Note: a) The tables must have appropriate primary key and foreign key declaration b) Since It is likely that you will run create.sql many times and you will run into the following problem. The first time you run it, Oracle creates the S, C, and G tables. The second time you run it, Oracle will not let you create the tables again since the tables are already in place. It is a common practice to drop the tables at first before you create them, like this drop table enrollmentsi drop table courses drop table students create table students.. create table Courses.. create table Enrollments .. Please label the 2. Create a file query.sql where you write SQL code of questions question number clearly with comments. Make sure you have set echo on in the b query.txt. Run query.sql file until there is no error eginning of the file and spool to urn i t out of the query.txt file 1. Display CNum, title and Grade of courses Andy took 2. Display SNum and SName of students who took IS380 3. Display SNum and SName 4. Display SNum and SName of students who are IS major and took IS380 5. Display Snum and Sname of 'IS' student who received an 'A' in 'IS380 6. Display SNum and SName of students who took IS380 but not an IS major. 7. Display SNum of students who took the 'Telecomm' course 8. Display SNum of students who received an 'A' from any of 'Lee's class 9. Display SNum and SName of students whose GPA is less than 2 but received an 'A' in Lee's class 10. Display SNum and SName of students who have 'Lee' as an instructor of students who took IS380 and received an 'A
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
