Question 3: Create the DDL statements to create the tables described in your modified ER diagram in question 2: DDL Statement: CREATE TABLE School ( school_code integer Primary Key(10), location varchar(25), name varchar(10) ); CREATE TABLE Professors ( staff_id integer(10), name varchar(20), school varchar(30) ); CREATE TABLE Course ( subject_code varchar(10), school varchar(30), name varchar(10) ); CREATE TABLE Subject ( subject_code(10), school varchar(30), name varchar(10) ); CREATE TABLE Student ( student_id number(10), name varchar(10), address varchar(30), phone number(10) ); Table Description desc table School; Select * from School; Name Null Type school_code Not null integer location Not null varchar(25) name Not null varchar(10) desc table Professor; Select * from Professor; Name Null Type staff_id Not null number(10) name varchar(20) school varchar(30) desc table Course; Select * from Course; Name Null Type subject_code Not Null varchar(10) school varchar(30) name varchar(20) desc table Subject; Select * from Subject; Name Null Type subject_code Not Null varchar(10) school varchar(30) name varchar(20) desc table Student; Select * from Student; Name Null Type student_id Not Null number(10) name varchar(20) address varchar(30) phone number(10) Question: In your Database you created in Question 3, assume there is a student record for student 12543 Paul Darbyshire who is enrolled in the course BIS Bachelor of Information Systems It is the beginning of Semester 1 2020. Paul wants to drop all his current subjects for this semester and change courses from the BIS course to the BHR Bachelor of Human Resources course. This is a new course and won’t begin until Semester 2 2020. Paul needs to be enrolled in the following 3 subjects for semester 2 2020 HR101 Introduction to Human Resources HR211 HR for Medium Level Enterprises HR201 HR for Dummies
Question 3: Create the DDL statements to create the tables described in your modified ER diagram in question 2:
DDL Statement:
CREATE TABLE School
(
school_code integer Primary Key(10),
location varchar(25),
name varchar(10)
);
CREATE TABLE Professors
(
staff_id integer(10),
name varchar(20),
school varchar(30)
);
CREATE TABLE Course
(
subject_code varchar(10),
school varchar(30),
name varchar(10)
);
CREATE TABLE Subject
(
subject_code(10),
school varchar(30),
name varchar(10)
);
CREATE TABLE Student
(
student_id number(10),
name varchar(10),
address varchar(30),
phone number(10)
);
Table Description
desc table School;
Select * from School;
Name Null Type
school_code | Not null | integer |
location | Not null | varchar(25) |
name | Not null | varchar(10) |
desc table Professor;
Select * from Professor;
Name Null Type
staff_id |
Not null | number(10) |
name | varchar(20) | |
school | varchar(30) |
desc table Course;
Select * from Course;
Name Null Type
subject_code | Not Null | varchar(10) |
school | varchar(30) | |
name | varchar(20) |
desc table Subject;
Select * from Subject;
Name Null Type
subject_code | Not Null | varchar(10) |
school | varchar(30) | |
name | varchar(20) |
desc table Student;
Select * from Student;
Name Null Type
student_id | Not Null | number(10) |
name | varchar(20) | |
address | varchar(30) | |
phone | number(10) |
Question:
In your
BIS Bachelor of Information Systems
It is the beginning of Semester 1 2020. Paul wants to drop all his current subjects for this semester and change courses from the BIS course to the BHR Bachelor of Human Resources course. This is a new course and won’t begin until Semester 2 2020. Paul needs to be enrolled in the following 3
subjects for semester 2 2020
HR101 Introduction to Human Resources
HR211 HR for Medium Level Enterprises
HR201 HR for Dummies
Discuss any changes you may need to make to your database from Question 3 given this information and provide the SQL statements in order to accomplish the above tasks.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps