0% found this document useful (0 votes)
51 views

Data Base and Management System Lab

1. The student performed set operations on database tables using UNION, INTERSECTION, and MINUS operators. 2. The student created tables for Engineering and Management students and entered sample data. 3. Queries were written to display all students, students with matching names, students with CGPA below 2.0, 5th semester students, and students with the same father's name.

Uploaded by

Arsalan Ishtiaq
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)
51 views

Data Base and Management System Lab

1. The student performed set operations on database tables using UNION, INTERSECTION, and MINUS operators. 2. The student created tables for Engineering and Management students and entered sample data. 3. Queries were written to display all students, students with matching names, students with CGPA below 2.0, 5th semester students, and students with the same father's name.

Uploaded by

Arsalan Ishtiaq
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/ 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