You are on page 1of 5

DATABASE MANAGEMENT SYSTEM LAB

Lab Journal#2

Name :
Enroll :
Class :

Department of Computer Science


BAHRIA UNIVERSITY, ISLAMABAD
Lab #: 02

Create a table of bank employees which includes their first name, last name, CNIC,
Designation, contact and date of birth.

Apply following queries on data.

Task 01:

Write a query for the creation of table which includes all the above mentioned field.

CREATE TABLE employees(

FIRSTNAME varchar(255),

LASTNAME varchar(255),

CNIC varchar(255),

DESIGNATION varchar(255),

CONTACT varchar(255),

DATEOFBIRTH varchar(255)

);

INSERT INTO employees VALUES('aymen','Zahid','01-134211-


015','Manager','03145334429','10/4/2003');

INSERT INTO employees VALUES('shanze ','malik','01-134211-081','Team


Lead','0314567432','11/05/2004')

INSERT INTO employees VALUES('anam ','ghaffar','01-134211018','Software


Engineer','03157649201','12/6/2000');

INSERT INTO employees VALUES('saiqa','rehmat','01-134211-


014','Designer','0332-4198620','04/09/2005')

INSERT INTO employees VALUES('inshira','fatima','01-622782-


16','Developer','0314529016754,'4/2/1979');

INSERT INTO employees VALUES('aliza ','zahid','01-134211-066','Quality


Controller','09132654698','11/04/2008')
INSERT INTO employees VALUES('maryam','abbasi','01564738291','Production
Manager','03146589243','11/6/2006')

INSERT INTO employees VALUES('Shumaila','Niazi','01-13422-098','Team


Lead','09867525419','1/05/1997')

INSERT INTO employees VALUES('ayesha','mudassir','01-134211-


051','Intern','03176843298,'11/2/2008')

INSERT INTO employees VALUES('tooba','zahid','01-134211-044','quality


assurance manager','03185643209,'19/3/2006')

Task 02:

Insert at least 10 rows in the table

SELECT * from employees

Task 03:

After creation of table, modify one column of table according to your choice.
ALTER TABLE employees

ADD ADDRESS varchar(255)

Task 04:

Write query to delete any data from the table.

DELETE from employees

WHERE LASTNAME ='Shahwar'


Task 05:

Implement WHERE clause on the table to update or delete the data of your choice.

UPDATE employees

SET FIRSTNAME ='Muhammad'

WHERE LASTNAME ='Shahwar'

You might also like