SQL Assignment 1
SQL Assignment 1
Library System
Tables-
Task / Problems:
1) Create the table Member, Books and Issue without any constraints as
mentioned in the schema description above.
2) View the structure of the tables.
3) Drop the Member table
4) Create the table Member again as per the schema description with the
following constraints.
5) Modify the table Member increase the width of the member name to 30
characters.
6) Add a column named as Reference of Char(30) to Issue table.
7) Delete/Drop the column Reference from Issue.
8) Rename the table Issue to Lib_Issue.
9) Insert following data in table Member
10) Insert at least 5 records with suitable data and save it.
11) Modify the column Member_name. Decrease the width of the member
name to 20 characters. (If it does not allow state the reason for that)
18) Insert more records in Book table using & operator in the insert
statement.
19) Create table Book101 similar to Book in structure with no data in
it.
20) Insert into Book101 all the data in Book table using Select
Statement.
21) Save all the data so far inserted in the tables.
22) View the data in the tables using simple SQL query.
23) Insert into Book following data.
105, National Geographic, Adis Scott, 1000, Science
24) Undo the last changes.
25) Modify the price of book with id 103 to Rs 300 and category to
RDBMS.
26) Rename the table Lib_Issue to Issue.
27) Drop table Issue.
28) As per the given structure Create table Issue again with following
constraints.
Lib_Issue_Id-Primary key
Book_No- foreign key
Member_id - foreign key
Issue_date <= system date.
Issue_date < Return_date
29) Insert following data into Issue table. Note leave the column
Return_Date blank.