DDL Assignments
1.
Create Student table with
Column Name Data type Size Constraint
SID NUMBER 5 Primary key
SNAME VARCHAR 30
ADDRESS VARCHAR 50
AGE NUMBER 2
ROLLNO VARCHAR 10
1. Create the above table
2. Alter the table to
1. Not null for sname,
2. Age can be only above 3,
3. Rollno unique
4. Default age 4
5. Add a new column contactno number
6. Drop the constraint check on the age column
7. Drop the column contactno
2.
Book
Column Datatype Constraint
BOOKID NUMBER PRIMARY KEY
BOOKNAME VARCHAR NOT NULL
AUTHOR VARCHAR
EDITION NUMBER DEFAULT 2
PRICE NUMBER
Member
COLUMN DATATYPE CONSTRAINT
MID NUMBER PRIMARY KEY
MNAME VARCHAR NOT NULL
MAILID VARCHAR
ADDRESS VARCHAR
Transaction
COLUMN DATATYPE CONSTRAINT
BID NUMBER FOREIGN KEY , PRIMARY KEY
MID NUMBER FOREIGN KEY , PRIMARY KEY
ISSUEDATE DATE DEFAULT SYSDATE
RETURN DATE DATE
1. Create the above tables without any constraints
2. Alter the table to add the above constraints
3. Add a new column called publication in book table.
4. Add a new column called membertype, which can be either student or faculty in the
member table
5. Rename the column price as bookprice in book table