DEPARTMENT OF ELECTRONICS & COMPUTER
ENGINEERING
Experiment No. 3: *1) Create Database for given application
2) Create tables for the given application
3)Assign Primary key for created table
4) Modify the table as per the application needs.
Required Resources with specifications:
Sr. Particulars Specification
No.
1. Operating system Windows 10 or higher
2. Disk space 8.5 gigabytes min for oracle
software, plus 2 gigabytes or
more for temporary storage
3. RAM 2 Gigabytes RAM minimum
4. Software mysql
DDL Table Operations
1. Perform the following operations step-by-step on a table named Employees:
2. Create Table
- Emp ID (integer)
- First Name (varchar 50)
- Last Name (varchar 50)
- Department (varchar 50)
- Salary (decimal 10,2)
3. Alter Table
- Add a new column Date Of Joining (DATE)
- Modify Last Name to VARCHAR(100)
- Drop the Department column
4. Truncate Table
- Use TRUNCATE to delete all rows from the table.
5. Rename Table
- Rename Employees to Staff.
6. Drop Table
- Drop the Staff table.
Apply Key Constraints
1. Create a Department table with:
- DeptID (integer, Primary Key)
- DeptName (varchar 100, NOT NULL, UNIQUE)
2. Create an Employees table with:
- EmpID (integer, Primary Key)
- FirstName (varchar 50, NOT NULL)
- LastName (varchar 50, NOT NULL)
- Email (varchar 100, UNIQUE)
- Salary (decimal 10,2, CHECK Salary > 0)
- DeptID (integer, FOREIGN KEY referencing [Link])
DEPARTMENT OF ELECTRONICS & COMPUTER
ENGINEERING
Screen shots