0% found this document useful (0 votes)
77 views9 pages

DB Lab-4 - (356324)

This document outlines 11 tasks for a database systems lab. The tasks involve creating tables, inserting records, updating records, deleting records, and writing queries. For each task, the document lists the steps to be performed which include taking tables from a previous lab database, running insert, update, delete, and select queries, and creating relationships between tables. The goal is to practice common database operations and create schemas based on given scenarios and entity relationship diagrams.

Uploaded by

Fahad Aqeel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views9 pages

DB Lab-4 - (356324)

This document outlines 11 tasks for a database systems lab. The tasks involve creating tables, inserting records, updating records, deleting records, and writing queries. For each task, the document lists the steps to be performed which include taking tables from a previous lab database, running insert, update, delete, and select queries, and creating relationships between tables. The goal is to practice common database operations and create schemas based on given scenarios and entity relationship diagrams.

Uploaded by

Fahad Aqeel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

MUHAMMAD FAHAD

CMS: 356324
Submitted to: Waqas Ahmed
12-11-2020

DATABASE SYSTEMS

LAB-4
TASKS
Task-1: Insert 10 record into DEPARTMENT table, which is created in previous Lab.

STEPS
 First we take the same table “DEPARTMENT” from the last lab database
 then we insert 10 records as mentioned above

Task-2: Insert 12 record


into EMPLOYEE table,
which is created in
previous Lab.
STEPS
 First we take the same table “EMPLOYEE” from the last lab database
 then we insert 12 records as mentioned above

Task-3: Update the EMPLOYEE table to set the commission of all employees to Rs
1800/- who are working as MANAGER

STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 After inserting the data, we update it.
 Update the commission of all the managers to Rs1800/- by using the Update and Set
command

Task-4: Create a pseudo table EMPLOYEE_2 with the same structure as the table
EMPLOYEE and insert rows into the table using select clauses.
STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 To create a duplicate table we use the “create table as select” command
 Another table will be created “Employee_2” with the same records.

Task-5: Delete all employees, who are working as "Cleark".


STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 Now we delete all the records who are “Clerks” by using the delete command.
 The results are shown

Task-6: Delete the employee, whose name is Qasim.

STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 Now we delete all the records who are “QASIM” by using the delete command.
 The results are shown

Task-7: List all employees, order by Job


In ascending order.
In descending order

STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 Now we sort the entries of Job decription in Ascending order first and the descending
order as shown using the Select order by command.
Task-8 : Display JOBS from the EMPLOYEE table avoiding the duplicated
values.
STEPS
 First, we take the same table “EMPLOYEE” from the last lab database
 Now we remove all the duplicate records in the job entity using the Select Distinct
command
 The results are shown

Task-9 : Create the schema, where we can store multiple files against
one user.

STEPS
 First, we create a Database
 Then we create a table “userdata” for a user with all its details as entities
 Then we create another table “DOCUMENTS” and enter the details of the users
documents.
 The results are shown

Task-10 : Create the schema of feature of whatsapp. (most recent


contact use for forward message).
STEPS
 First, we create a Database
 Then we create a table “WHATSAPP” for a user with all its details as entities
 Then we order the messages in Descending order
 The results are shown below

Task-11 : Create the schema


from the following ERD .You
have to include created_at, updated_at columns.
STEPS
 First, we create a Database
 Then we create a table “GROUP”, “STUDENTS”, “SUBJECTS”, “MARKS”, “TEACHERS”,
SUBJECT/TEACHER
 write the entities as shown in the ER Diagram.
 Then we Reference the Foreign keys to the respective tables as shown
 The results are shown below

=====================================================================================

THANK YOU

You might also like