Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can you solve this by using sql oracle live ( i attach the table to be filled ) and i want the output ( the

can you solve this by using sql oracle live
( i attach the table to be filled )
and i want the output ( the pic of the table after inserting the data )
thank you
image text in transcribed
image text in transcribed
image text in transcribed
Lab Exercise Using the SQL Live, adding to the work you did in Lab3. Perform the following: 1) Add the following department to the DEP Table: DEPTNO = ' CCM ' and DNAME = 'Chemistry' 2) Add the following COURSE: (301, 'Chemistry I', 'CM', 40). 3) Iry to add the COURSE: (101, 'Introduction to DOS', 'CP', 30), Discuss the result. 4) Try to add the COURSE: (101, 'Introduction to DOS', 'CP', 30). Discuss the result. 5) How many rows are inserted correctly into each of the COURSE and DEP tables? 6) Execute the following SQL Query: SELECT FROM DEF; How many rows you get? 7) Execute the following SQL Query: SELECT + FROM COURSE; How many rows you get? 8) Right now, do the rows are permanently inserted into the tables? Discuss. 9) ROLLBACK the transaction. What is happened? 10) If the rows are not permanently inserted, execute a statement to save the inserted rows. Now suppose we want to empty the two tables DEP and COURSE. 11) DELETE the rows in the DEP table first. Discuss the result and solve the problem to empty the two tables properly. 12) Check that the two tables are empty. 13) Extend the table DEP with a new column NBEMP to store the NUMBER(2) of employees in each department. 14) Remove the two tables DEP and COURSE. University of leddah I College of Computer Science \& Engineering. - For each query screenshot the SQL code and the result table. - Arrange everything in 1 file by the query number. - Add a cover page \& Upload your work to Blackboard as a PDF file CREATE TABLE STUDENT I STDNO NUMBER ( 8) PRIMARY KEY, SNAME VARCHAR2 (30) NOT NULL, DEPTNO NUMBER(2) if CREATE TABLE DEP DEPTUO NUNBER (2) PRIMARY KEY, DNAME VARCHARZ (20) CREATE TABLE COURSE ( CORSHO NUMBER (3) PRIMARY KEY, CNAME VARCHAR2 (30). DEPTNO NUMBER (2) 1) CREATE TABLE ENROLMENT ( STDNO NUMBER (8) PRIMARY KEY, CORSNO NUNBER (3) PRIMARY KEY, GRADE NUMBER(2). EDATE DATE DEFAULT SYSDATE ALTER TADLE STUDENT ADD FOREIGN KEY (DEPTHO) REFERENCES DEP (DEPTNO); ALTER TABLE COURSE ADD FOREIGN KEY (DEPTNO) REFERENCES DEP (DEPTNO); ALTER TABLE ENROLMENT ADD FOREIGN KEY (STDHO) REFERENCES STUDENT (STDNO), ADD FOREIGN KEY (CORSNO) REFERENCES COURSE (CORSNO)

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

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago

Question

What tools might be helpful?

Answered: 1 week ago