Database Systems
Lab Exercises
- Create a table Faculty based on the followingchart:
Column | Data type | Constraints |
Faculty_Id | Number (6) | Primary Key => faculty_pk |
Last_Name | Varchar2(15) | Not NULL |
First_Name | Varchar2(15) | Not NULL |
Dept | Char(3) | |
Save the SQL statement as ex1.sql. Confirm and validatethe creation of the new table.
- Create a table Dept based on the followingchart:
Column | Data type | Constraints |
Dept_Code | Char (3) | Primary Key => dept_pk |
Dept_Name | Varchar2(20) | Not NULL |
Save the SQL statement as ex2.sql. Confirm and validatethe creation of the new table.
- Add a new column Location toDept table which has data type Char(7). Save theSQL statement as exsql. Confirm and validate themodification of the table.
- Add a new FOREIGN KEY constraint (namedfaculty_dept_fk) to column Dept onFaculty table that refers to columnDept_Code on Dept table. AddON DELETE CASCADE option. Save the SQL statementas exsql. Confirm and validate the modification of thetable.
- Increase Last_Name column to25 characters long. Save the SQL statement asexsql. Confirm and validate the modification of thetable
use this to draw https://www.diagrameditor.com/