Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you please help me write the codes along with the output for this question? Probents Use Orade SQL to create a script file to

can you please help me write the codes along with the output for this question? image text in transcribed
image text in transcribed
Probents Use Orade SQL to create a script file to declare relation schemas, inserts duta records into the relations, and query the relations. 1. (4 points) Create tables CoursesDesctiption and CoursenSpring202L. conforming to the following constraints: - In table Courseapeneription: Every course has either 1. 2, 3, or 4 credit hours A course eitber has one prerequisite or no prerequisite all at If it does have a prerequisite, the prerequisite must be an existing course When deleting a record of a course c1 which is a prerequisite of another course cz, the prerequisite field of c2 should be set to nall. - In table Cour aesspring2021: D Every course ofiered in Spring 2021 has a unique course reference number (crn) - By default, the seatCapacity of a coarse is 24 - For every course, the value of seat 7aknn (number of seats that have been taken) should never exceed the value of seatCapact iy - Every course (its cno) should be an existing course in table CourseDescription - When deleting a record of a course c1 from table Coursesbeser iption, all sections of course cl should also be removed from table coursesspring2021. Note: All necessary constraints mast be dedared before any actual data is inserted into the relations. Hint: - You can define a foreign key far a relation that refereaces attrabutes in ies own 2. ( 0.5 point) Find cno and ceedic s of the courses that have prerequisites. The query for the above pove relations should return 3. (1 point) Find the namber of courses with "cac' as the prefix in cho. The query for the above given relations should return: ceschocerf 4. (1 point) List crm, eno and seat taken of courses that are effered in 5pring 2021 in the descending arder of the course number (eno), and ascending order of the number of seats that have been taken if the course number is the same. The cquery for the above piven relations should return: 5. (1 point) Find the lowest enrollment among all sections of CSC190 that are offered in Spring 2021. The query for the above given relations should return: 6. (1 point) Find the total enrollment (LE, total number of seats taken) in courses offered by cse department in Spring 2021. The equery for the abeve given relations should return: CsCENRDtyesrt 75 7. (1.5 points) Write and execute a PL/SQL function that * increases the seat capacity to 50 for all 100 -level courses fee and 110 , che 120 and inf100] - returns the average enrollment of 100 -level courses

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

LO14.2 Discuss how game theory relates to oligopoly.

Answered: 1 week ago