Sie sind auf Seite 1von 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

Das könnte Ihnen auch gefallen