Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want u to programing this questions by Oracle code and use comments w the codes please Homework 4 SQL: Join, Integrity Rules 1. Create

I want u to programing this questions by Oracle code and use comments w the codes please image text in transcribed
Homework 4 SQL: Join, Integrity Rules 1. Create a file create.sql where you create the following tables and insert all test records. Make sure you have set echo on in the beginning of the file. Spool your output to create.txt Run create-sgl until there is no error. Tumma print out of the create.txt file. Courses Students Num Andy IN 38 101 101 102 103 S380 B IS385 A IS380 A IS355 B S380 Database Lee IS385 Systems S355 elecomm Lee Andy IS 102 Betty FIN 03 Cindy IS 1.8 Smith Field definitions: SNum varchar2(3) SName varchar2(25) Major varchar2(20) GPA Number(3,2) CNum varchar2(8) Grade varchar2(1) CTitle 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 enroliments: drop table courses drop table students: create table studentsi create table Courses create table Enroliments 34 Spring 2018 IS 380 Lecture Notes 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 beginning of the file and spool to query.txt. Run query.sal file until there is no error. Turn in a print out of the query.txt file, Please label the 1. Display CNum, tle and Grade of courses Andy took. 2. Display SNum and SName of students who took IS380. 3. Display SNum and SName of students who took IS380 and received an 'A 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

Calculate a utility estimate for a target organization

Answered: 1 week ago