Вы находитесь на странице: 1из 5

1.

Create department and employee tables

2. Insert data into tables


3. Display all information of all departments
4. Display all information of all employees

5. insert following tuples into the table EMPLOYEE.


(100, ‘Sarath’, ‘Matara’, 30, ‘ACC’)
(101, ‘Nazeeha’, ‘Mannar’, 34, ‘DEP’)
(103, ‘Arjun’, ‘Mannar’, 40, ‘MAN’)

6. a. Change the foreign key constraint with ‘ON UPDATE RESTRICT’.

mysql> ALTER TABLE employee add constraint fk_emp FOREIGN KEY(dept)REFERENCES


department(DeptCode) ON UPDATE RESTRICT;
Query OK, 13 rows affected (0.12 sec)
Records: 13 Duplicates: 0 Warnings: 0
b. Change DeptCode ‘FIN’ of department table to ‘ACC’.

c. Change the Deptcode of Department Table to ‘MAK’.


d. Display all the information of all employees.

Sir is not there


Sir was not there

Вам также может понравиться