21bce9836 DBMS Lab Assignment-1
21bce9836 DBMS Lab Assignment-1
21bce9836 DBMS Lab Assignment-1
1
2)Create a Table Department with
attributes
DNo,DNAMe,ManagerSSN,MgrStartdate.
CODE:
mysql> CREATE TABLE DEPARTMENT (
-> Dno TINYINT NOT NULL,
-> DName VARCHAR(255) NOT NULL,
-> ManagerSSN MEDIUMINT NOT NULL,
-> MgrStartDate DATE NOT NULL
-> );
Query OK, 0 rows affected (0.01 sec)
2
3)Insert the data given above in both employee,
department and project tables.
CODE:
EMPLOYEE
3
Department
CODE:
mysql> INSERT INTO DEPARTMENT VALUES (01, 'Computer Science',
98512, '2021-11-01');
Query OK, 1 row affected (0.00 sec)
4
(TO DISPLAY INFORMATION ABOUT DEPARTMENT TABLE)
5
6)Display the employee names whose bdate is
’29-MAR-1959’.
CODE:
mysql> SELECT * from EMPLOYEE WHERE birthday= '1959-03-29';
6
8)Display the MgrSSN, MgrStartDate of the
manager of ‘Finance’ department.
CODE:
mysql> SELECT ManagerSSN, MgrStartDate FROM DEPARTMENT
where DName = 'finance';