Data Base and Management System Lab

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Data Base and Management System Lab

CSL-220
 

Lab journal 10
 

Student’s Name: Arsalan Ishtiaq


Enrolment number(s): 01-134182-013
Class: BS (CS) – 4B
 
 
 

 
 
Department of Computer Sciences
BAHRIA UNIVERSITY, ISLAMABAD
Lab # 10
Set operations

LAB TASKS
1. Use the set operators on emp and dept table:

Using the UNION operator

Query
select emp_id, emp_name, emp_location from eoe03 Union select department_no,
department_name, department_location from department02;

Output

Using the INTERSECTION operator

Query
select emp_location from eoe03 INTERSECT select department_location from
department02;
Output

Using the MINUS operator

Query
select emp_id from eoe03 MINUS select department_emp_id from department02;

Ouput
2. Make two tables for Engineering student and Management Student

Engineering Student

Data Entry
Management System

Data Entry
3. Show all students

Query
select*from Engineering_Student Union select* from Management_Student;

Output

4. Show students who have same name

Query
select Student_name from Engineering_Student intersect select Student_name from
Management_Student;
Output

5. Show students from both table whose cgpa is below 2.00

Query
select* from Engineering_Student where Cgpa < 2.00 Union select * from
Management_Student where Cgpa < 2.00;

Output

6. Show students of 5th semesters only

Query
select *from Engineering_Student where Semester = 5 Union select * from
Management_Student where Semester = 5;

Output
7. Show Students whose father’s name are same

Query
select Student_father from Engineering_Student intersect select Student_father from
Management_Student;

Output

You might also like