Lab 2
Lab 2
In previous lab, we designed a database using DDL commands, in this lab we will practice DML
commands.
There are 4 type of DML commands.
1. Insert
2. Update
3. Delete
And to display or search from table we use “Select” command.
INSERT
Insert into ‘table name’ (column names) values (value to be
inserted)
Your task is, using insert command, populate your table with data, there should be at least 8,10
rows inserted in each table.
Update
update ‘table name’ set ‘column name’=’value to be updated’ where
‘column name’=value from table
You have to take screenshot of your table, then write a update command for a record and run the
command, after update again take screenshot and display.
Delete
Delete from ‘table name’ where ‘column name’=value
Using above given command, delete a record from table, you have to take before and after
deletion screenshot of the table.
INSERT INTO Business_Information(System_Name ,Starting_Year
,Email,Country,Phone_Number,Landline_No , Aaddress)
values ('Garage',2021,'[email protected]','Pakistan',03200,0423714,'Chahon Park Islampura
Lahore')
,('Garage',2022,'[email protected]','Pakistan',03200,0423714,'Islampura Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'Ravi Road Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'Ali Town Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'DHA Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'DHA Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'Gulshan ravi Lahore')
,('Garage',2021,'[email protected]','Pakistan',03200,0423714,'mall road Lahore')
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
update Business_Information set Phone_Number=030042 where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'
Delete from Business_Information where Email='[email protected]'