Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 3 SQL Assignment 2 For the first 2 questions, you first need to type each code and execute them on Oracle, and then try

image text in transcribed

Assignment 3 SQL Assignment 2 For the first 2 questions, you first need to type each code and execute them on Oracle, and then try to make changes to the schemas by using appropriate table-altering commands. Type the following relation schema and execute it drop table STUDENT cascade constraints; create table Student 1. name varchar2 (30) not null, StudentNumber number (4) not null, class number (2) , major varchar2 (4), primary key (StudentNumber)) a. Change the data type of StudentNumber from number (4) to number (10) b. Rename the attribute StudentNumber to SID. (Assume that only the schema of the STUDENT table is created and the table is not populated yet) Rename the STUDENT table to STUDENTINFO c. 2. Type the following code and execute it. drop table section cascade constraints; create table section ( CourseNo char (8), SectionID number (4) , InstructorSSN number (9), constraint section_pk primary key (CourseNo, SectionID), constraint section ct check (instructorSSN is not ull) ) Add an attribute deptName of varchar2(25) Disable the constraint section ct. a. b. c. Drop the attribute deptName. 3. Be sure you are done with the first two questions before proceeding to the question No. 3 a. Download createDB.sql and execute it. b. Update the prerequisite of the course CS3320 to CS1310. c. Delete all the prerequisites for the course CS3380 Use appropriate SQL command to answer the following questions: 4. List the names of all your tables (i.e. the tables under your schema.) 5. List the attribute names and data types of the table STUDENTINFO

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

Students also viewed these Databases questions