0% found this document useful (0 votes)
11 views3 pages

Lab Practice Sheet-2 (DML)

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

Lab Practice Sheet-2 (DML)

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

Department of Computer Science & Engineering

(Artificial Intelligence / Artificial Intelligence & Machine Learning)

Lab-2 (DML commands)

Objective: To create tables, populate it with data and retrieve specific data.

Hands on Exercise: SELECT Statements:

1. Display all the information of EMP table.


2. Display all the information of DEPT table.
3. Display unique Job from EMP table.
4. Display the details of SMITH.
5. Display unique department number with jobs.
6. List all the clerks.
7. Display the details of Blake.
8. List the empno, salary and commission of employees.
9. List the employees who joined before 1981.
10. List the employees who joined after the second half of 82.
Department of Computer Science & Engineering
(Artificial Intelligence / Artificial Intelligence & Machine Learning)

Lab Exercise-2

QUERY 1: Create student table with the following Query 2: Create faculty table with the following
given structure: given structure:

Column Name Data Type Size Column Name Data Type Size
roll_no number 12 faculty_name varchar2 20
name varchar2 20 faculty_id number 8
semester number 6 department varchar2 10
section varchar2 6 Subject varchar2 20
branch varchar2 6
percentage number 6
pcps number 6
city varchar2 15
contact_no number 10

Query 3: Insert following records into student table:


roll_no name semester section branch percentage pcps city contact_no
116113001 Abha 4 A IT 95 0 NOIDA 9999111100
116103002 Piyush 4 B CSE 59 2 Ghaziabad 9989111100
116113003 Shalabh 4 A IT 88 0 NOIDA 9989111100
116103004 Amit 4 B CSE 55 2 NOIDA 9999111101
116113005 Anita 6 A IT 60 1 Ghaziabad 9999111102
116103006 Meena 6 B CSE 78 0 Ghaziabad 9999111103
116113007 Ankita 6 A IT 75 0 NOIDA 9999111104

Query 4: Insert following records into faculty table:


faculty_name faculty_id department subjects
Galvin 0001 CSE Operating System
Galvin 0001 CSE Computer Network
Tanenbaum 0010 IT Data Structures
Tanenbaum 0010 IT Object Oriented
Vandana 0034 Maths MathematicsIII
Tanenbaum 0010 IT Computer Organization
Ravi 0078 CSE Web Technology

Query 5: Display all records of students.


Query 6: Display all records of faculty.
Query 7: Display names and percentage of all students.
Query 8: Display faculty and their departments.
Query 9: Display all records of clear pass students.
Query 10: Display all faculty records of maths department.
Query 11: Display names of all students who scored more than 80 percent.
Query 12: Display names of Data Structures faculty.
Query 13: Display sorted list of students according to percentage scored by them.
Department of Computer Science & Engineering
(Artificial Intelligence / Artificial Intelligence & Machine Learning)

Query 14: Eliminate the duplicate branch description when retrieving data from the branch column
of student.
Query 15: Prof. Ravi has left the college. Delete records of Prof Ravi as it is no longer needed.
Query 16: Delete records of all students who are having pcps in more than one subject.

You might also like