DBMS Lab 03 (Bukc)
DBMS Lab 03 (Bukc)
Karachi Campus
02 Retrieve the product names and their corresponding quantities in stock for products with UnitsInStock
below 50. Also sort the list by UnitsInStock in descending order. (Table: Products)
03 From customers table, count all customers in each region whose contactTitle does not contain manager and
region is not null. (Table: Customers)
04 Write a query to display the number of ContactName with same ContactTitle. Sort contact title in
ascending order. (Table: Customers)
05 List the employee id, names and their hire dates for employees hired after the year 1992. Order the results
by hire date in ascending order. (Table: Employees)
06 Display the highest, lowest, sum and average UnitPrice of each Category, where highest UnitPrice lies in
the range of 100$ to 500$. Label column as CategoryId, Maximum, Minimum, Sum and Average,
respectively. (Table: Products)
07 How many people are in each unique city in the employee table that have more than one person in the city?
Select the city and display the number of how many people are in each if it's greater than 1.(Table:
Employees)
08 Find the product name, maximum price and minimum price of each product having maximum price greater
than 20.00 $. Order by maximum price. (Tabel: Products)
09 Write a query to list no of customers with same ContactTitle if No of customers is greater than 5.
However, their ContactTitle does not contain Manager. Order by contact title in descending order (Table:
Customers)
10 Retrieve the count of products in each category where the unit price is less than 30 dollars. Label the
columns as CategoryID and ProductCount. (Tables: Products)
Submitted On:
Date: 25/02/2025
[Lab no. 03] [Database Management
System Lab]
[Aggregate Functions in
SQL]
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output:
Output: