Professional Documents
Culture Documents
Dbms (1) Final
Dbms (1) Final
Karachi Campus
COURSE: CEN-221
Database Management System Lab
TERM: FALL 2022, CLASS: BSE- 4(A)
Submitted By:
_______________________________________________
(Name) Zuhaib Shamsher (Reg. No.) 02-131222-104
Submitted To:
LIST OF TASKS
TASK NO OBJECTIVE
1 a) Get Order id, Product id, Unit price from Order Details.
b) Display all cities that employees belong to but don’t allow repetition.
c) Find complete name of all employees.
d) Display data of all employees those working as Sales Representative.
e) Display complete name of employees those livesin London.
f) Display product name whose unit price are greater than 90$.
g) List the name of all employees whose first name starts with the letter ‘A’.
In Customer table, display all cities that ends with the letter ‘a’.
h) Display names of all employees whose name contain ‘an’.
Display all the orders where unit price lies in the range of 10$ to 40$.
i) Display the company name where Region is NULL in Customer Table.
j) Write a query to list employees who live in London, Seattle or Redmond
k) Write a query to list employees whose address contains 3 numbers in its start.
Write a query to list employees whose address does not contain Rd.
l) Write a query to listthose employees whose TitleofCourtesy does not starts
with M.
m) List order whose ShipRegion is not Null.
n) List all products where UnitPrice is between 10 and 15 and QuantityPerUnit
contains “bottles”.
o) List all products where UnitPrice is not in 10,12,15,17 or 19.
Submitted On:
Date: _17/02/2024__
[Lab no. 01] [Database Management System Lab]
[Querying Database Tables Using Select]
Solution:
Output:
Solution:
Output:
Solution:
select FirstName +' '+ LastName as fullname from Employees
Output:
Solution:
select * from Employees where title='sales representative'
Output:
Solution:
select Firstname +' '+ Lastname as fullname from Employees where city='london'
Output:
Solution:
select productname from Products where UnitPrice>90
Output:
Solution:
select firstname +' '+ lastname as fullname from Employees where FirstName like 'A%'
Output:
Solution:
select firstname +' '+ lastname as fullname from Employees where City like '%an%'
Output:
Task No. 9:
“m) Display the company name where Region is NULL in Customer Table “
Solution:
select CompanyName,Region from Customers where Region is NULL
Output:
Solution:
select FirstName+''+LastName as FullName from Employees where City in ('London','Seattle','Redmond')
Output:
Solution:
Output:
Solution:
select FirstName+''+LastName as FullName from Employees where TitleOfCourtesy not like '[^M]%'
Output:
Solution:
select * from Orders where ShipRegion is not null
Output:
Solution:
select * from Products where unitprice between '10' and '15' and QuantityPerUnit like '%bottles'
Output:
Solution:
select * from Products where unitprice not in ('10','12','15','17','19')
Output: