Concept explainers
Explanation of Solution
Course table:
This table tells about the courses that are taught at the university.
Table creation:
CREATE TABLE COURSE (CourseID int primary key, CourseName varchar2(10));
The above query is used to create a table named “COURSE” with two columns named “CourseID”, and “CourseName”.
Inserting values:
INSERT INTO COURSE VALUES (101, 'Mathematics');
INSERT INTO COURSE VALUES (102, 'Computer Science');
INSERT INTO COURSE VALUES (103, 'Information technology');
The above queries are used to insert values into the table named “COURSE”.
After creating and inserting values, view the table by executing the query “SELECT * FROM COURSE”.
Screenshot of the table “COURSE”
Faculty table:
This table tells about the professors who teach those courses.
Table creation:
CREATE TABLE FACULTY (FacultyID int primary key, Name varchar2(10), CourseID int references COURSE);
The above query is used to create a table named “FACULTY” with columns named “FacultyID”, “Name”, and “CourseID”.
Inserting values:
INSERT INTO FACULTY VALUES (111, 'Adams', 102);
INSERT INTO FACULTY VALUES (112, 'Charles', 103);
INSERT INTO FACULTY VALUES (113, 'Bekki', 101);
The above queries are used to insert values into the table named “FACULTY”.
After creating and inserting values, view the table by executing the query “SELECT * FROM FACULTY”.
Screenshot of the table “FACULTY”
Student table:
This table tells about the students who takes those courses.
Table creation:
CREATE TABLE STUDENT (StudentID int primary key, StudentName varchar2(10), CourseID int references COURSE);
The above query is used to create a table named “STUDENT” with columns named “StudentID”, “StudentName”, and “CourseID”.
Inserting values:
INSERT INTO STUDENT VALUES (201, 'Zara', 102);
INSERT INTO STUDENT VALUES (202, 'Ryo', 101);
INSERT INTO STUDENT VALUES (203, 'Maya', 102);
The above queries are used to insert values into the table named “STUDENT”...
Want to see the full answer?
Check out a sample textbook solutionChapter 12 Solutions
Computer Science Illuminated
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education