DBMS Lab
DBMS Lab
2019-CS-682
Muhammad Bilal
Section:B
TASK 1:
Create the following table using SQL and using the INSERT INTO
command, insert the following values in the table created.
Name Reg_No Courses Course_Code Offered_By
Ikram 09 DIP
Hassan 10
Answer:
Commands:
1) For creating database
CREATE DATABASE labtask3
Output
TASK 2:
Using the UPDATE statement, update the above table for the following values:
Answer:
Command used to update table named persons
UPDATE Persons
SET Courses = 'DSP', CourseCode = 1005,
OfferedBy='Mr.Z'
WHERE RegNo = 10;
UPDATE dbo.Persons
SET CourseCode=1001,OfferedBy='Mr.A'
WHERE RegNo = 9;
TASK 3: Using the DELETE statement,
delete the record for the student having
name Akram and Ahsan in the above
table. Also delete the record for the
course having course code=1001.
Answer:
Commands Used to delete records name
Akram and Ahsan for coursecode=1001
END