0% found this document useful (0 votes)
25 views2 pages

A & B Section Question Paper

i. The document is a midterm exam for a Database Systems course covering SQL questions. ii. Question 1 asks students to write SQL commands to retrieve customer, order, and product information from given database schemas. iii. Question 2 asks what records would be returned by a SQL statement searching for names like '%mr%'. iv. Question 3 provides a description of a temporary employment system and asks students to create corresponding SQL tables based on the description.

Uploaded by

Shoaib Ur
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)
25 views2 pages

A & B Section Question Paper

i. The document is a midterm exam for a Database Systems course covering SQL questions. ii. Question 1 asks students to write SQL commands to retrieve customer, order, and product information from given database schemas. iii. Question 2 asks what records would be returned by a SQL statement searching for names like '%mr%'. iv. Question 3 provides a description of a temporary employment system and asks students to create corresponding SQL tables based on the description.

Uploaded by

Shoaib Ur
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/ 2

COMSATS University Islamabad

Sahiwal Campus
(Department of Computer Science)
Course Title: Database Systems Course Code: Credit Hours: 4(3,1)
Course Instructor: Zamzam Darwaesh Programme Name: BSSE
Semester: 4th Batch: FA21 Section: A & B Date: 18-05-2023
Time Allowed: 180 Minutes Maximum Marks: 25
Student’s Name: Reg. No. CUI/ /SWL
Important Instructions / Guidelines:
Read the question paper carefully and answer the questions according to their statements.
Mobile phones are not allowed. Calculators must not have any data/equations etc. in their memory.
Midterm Examinations Spring-2023

Q # 1.
Consider the following database schema of the Customer order system, where the primary keys
are underlined.
Customer (customeld, ename, address, balancedue)
Product (productId, description, qtyavailable, price)
Order (orderld, orderdate, customerid)
Order Detail (orderld, productId, quantity)

Write SQL commands to do each of the following (any five): [10 Marks]

i. For all customers, list their names and address.


ii. For a given order with orderld=7001, list all the ordered products in terns of productid,
product's description and the price (per unit).
iii. For all products that contain the word shoe in its description and are priced over Rs.3000,
list the product details in terms of description, productid and the price. Sort the output
first according to the price in decreasing order, then according to the description
alphabetically.
iv. Count the total number of orders from the order table.
v. Count the customer wise number of orders.
vi. Change the address of Singh Associates to 'E2,24-C' and Balance to 80,000
vii. List employees whose name have “I” as 3rd character followed by any number of
characters. [CLO4-C3/SO4]

Q # 2.
SELECT * FROM Persons
WHERE FirstName LIKE '%mr%';
[05 Marks]

what does the above statement return? [CLO4-C3/SO4]

Q # 3.

Page 1 of 2
Temporary Employment Corporation (TEC) places temporary workers in companies during peak
periods. TEC's manager gives you the following description of the business: TEC has a file of
candidates who are willing to work. If the candidate has worked before, that candidate has a specific
job history. Each candidate has several qualifications. TEC also has a list of companies that request
temporaries. Each time a company requests a temporary employee, TEC makes an entry in the
openings folder. This folder contains an opening number, company name, required qualifications,
starting date, anticipated ending date, and hourly pay. Each opening requires only one specific or
main qualification. When a candidate matches the qualification, he/she is given the job, and an entry
is made in the placement record folder. This folder contains an opening number, candidate number,
total hours worked, and so on. In addition, an entry is made in the job history for the candidate.

Read the above description and create tables in SQL accordingly. [10 Marks]

[CLO4-C3/SO4]

The End

Page 2 of 2

You might also like