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

COMP238-Lab-Manual-6 - 34002 Assignment 2

The document outlines a lab journal for a Database Management System course at Minhaj University, focusing on set operations and aggregate functions. It includes tasks for creating tables for bikes and cars, performing union, intersection, and except operations, as well as counting and averaging records. The lab aims to provide hands-on experience with SQL queries related to the created tables.

Uploaded by

aqeelat36
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)
4 views3 pages

COMP238-Lab-Manual-6 - 34002 Assignment 2

The document outlines a lab journal for a Database Management System course at Minhaj University, focusing on set operations and aggregate functions. It includes tasks for creating tables for bikes and cars, performing union, intersection, and except operations, as well as counting and averaging records. The lab aims to provide hands-on experience with SQL queries related to the created tables.

Uploaded by

aqeelat36
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/ 3

Minhaj University, Lahore Campus

Department of Computer Sciences


Lab Journal 06
Course: Database Management System Lab Date:

Course Code: CSL 220 Max Marks:

Faculty’s Name: Lab Engineer:

Name: ____________________________________ Enroll No: _______________________

OBJECTIVE:
The objective of this lab session is to learn Set operations Union, intersection, Except
and Aggregate Functions
Create this table Bikes and insert 5 Create this table Cars and insert 5
records records

create table bikes create table cars (


(bikes varchar (15), car varchar (15),
model varchar (15), model varchar (15),
Yearr varchar (15), Yearr varchar (15),
colour varchar (15), colour varchar (15),
owner_name varchar (15), owner_name varchar (15),
owner_id int ); owner_id int );

Task 1
1. Find union of car and owner_name
from both tables

2. Practice another union statement.

3. How to find distinct values using


union statement

4. Practice another union all statement


Task 2
1. Show only 1st row of table bikes

2. Show 1st three rows in table car

3. Practice except operator

4. Find intersection of car and bikes from


both tables

Task 3
1. Show the Count of total numbers of
records in table cars

2. Count total numbers of records in


table bikes

3. Retrieve the total Count number of


cars having colour grey

4. Show the total Count number of cars


having model 2011

5. Retrieve minimum year in cars

6. Display minimum model from the


table bikes
Task 4
1. Show maximum year in bikes

2. Display maximum model from the


table cars

3. Retrieve average owner_id in cars

4. Show average model from the table


bikes

5. Find sum of year in cars

You might also like