In: Computer Science
1. Write CREATE TABLE statements for the following tables (foreign keys are in italic and bold). Make sure you have all needed constraints and appropriate datatypes for attributes:
Student (stID, stName, dateOfBirth, advID, majorName, GPA)
Advisor (advID, advName, specialty)
2. Insert several records in each table.
CREATING TABLES :
FOR STUDENT:
CREATE TABLE Student ( stID number(5) , stName varchar2( 20 ) , dateOfBirth date , advId number( 5 ) , majorName varchar2( 30 ) , GPA varchar2(2 , 5 )); // COMMAND FOR CREATING TABLE IN SQL USING CREATE TABLE FOLLOWED BY TABLE NAME AND DATA.
FOR ADVISOR :
CREATE TABLE Advisor (advID number(5) , advName varchar2(30) , speciality varchar2(20) ); // COMMAND FOR CREATING TABLE IN SQL USING CREATE TABLE FOLLOWED BY TABLE NAME AND DATA.
INSERTING SEVERAL RECORDS IN EACH TABLE :
FOR STUDENT TABLE :
FOR ADVISOR TABLE :