Instructions: Assignment-01 Spring 2023

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Faculty of Computing and Information Technology (FCIT)

Department of Computing Indus University, Karachi

NAME OF STUDENT: Muhammad Hassaan ID No: 1761-2021

Assignment-01
Spring 2023
Department Faculty Total
Program Semester Course Title Instructor Issue Date Due Date Marks
/ Faculty Signature
BS 4th , Database Ms. Saba
FCIT Computer Offer No Systems 15/04/2023 29/04/2023
Science 66297 5

Instructions
1. This paper contains 2 Questions. Attempt all questions.
2. This assignment should be completed within assigned time, after the due date, assignment will not be
accepted.
3. Students of particular course will download assignment and submit solution which will only be
accepted through CMS portal. Also bring hardcopy with you.
4. Please ensure that no part of your assignment should be copied from any other source without
acknowledgment of the source and proper referencing (IEEE).
5. Please note that copy-paste is a serious nature of academic dishonesty, it is called “Plagiarism” and
the penalties are attached to being found guilty of committing suchoffenses.
6. It is allowed using lecture notes, books, and other sources, however needing to refer/cite properly,
Reference list must be given at end of the assignment.
7. Assignment can be compressed or break in two parts if file size is larger than uploadinglimit.
8. The font size should be 12 in Times New Roman, Line Space 1.5, Main Heading font size Bold 14,
Subheading font size 12 Bold and text font size 12 should be used. All figures and illustrations should
be properly titled or numbered on the left side, below.
9. Also ensure that no part of your assignment has been written by any other person, except to the extent
of collaboration and /or group work.
10. You must have to upload the source file of this assignment.
11. Expected outcome of this assignment follows CLO # 3 (C3, PLO-3) –
Cognitive (Design/Development of Solutions)

This table is for official use; do not write anything on it.

CLOs CLO_3 CLO_3 Total


Question 1 2
Number
Student’s Score
Maximum Score
2.5 2.5 5
Faculty of Computing and Information Technology (FCIT)
Department of Computing Indus University, Karachi

NAME OF STUDENT: Muhammad Hassaan ID No: 1761-2021


Assignment # 1
Spring 2023
Database Systems

Expected Outcome: Total (5 marks)


CLO 3: Achieve the ability for developing solutions that meet specified needs of an engineering
Question
problems1:
at Solve the queries
hand. (C3, PLO-3) in SQL server given below by following this table: (2.5 M)
Salesman_ID Name City Commission
5001Cognitive Domain:James Hooq New York 0.15
3 (Cognitive); PLO-3: Design/Development of Solutions
5002 Nail Knite Paris 0.13
5005 Pit Alex London 0.11
5006 Mc Lyon Paris 0.14
5003 Lauson Hen 0.12
5007 Paul Adam Rome 0.13

a) Write a query to produce a list of salesman_id, name, city and commision of each salesman who live in
cities other than Paris and Rome.
b) Write a SQL statement to find those salesmen with all other information and name started with any
letter within 'A' and 'K'.
c) Write a SQL statement to find all those customers with all information whose names are ending with
the letter 'n'.
d) Write a SQL statement to find those salesmen with all information who come from the city either Paris
or Rome.
e) Write a SQL statement to find those salesmen with all information who gets the commission within a
range of 0.12 and 0.14.
f) Write a SQL statement to find those salesmen with all information whose name containing the 1st
character is 'N' and the 4th character is 'l' and rests may be any character.
Faculty of Computing and Information Technology (FCIT)
Department of Computing Indus University, Karachi

Question 2: Solve the queries in SQL server given below by following this table:
a) Write a SQL statement to find the average purchase amount of all orders.

b) Write a SQL statement to find the total purchase amount of all orders.
c) Write a SQL statement to get the minimum purchase amount of all the orders.
d) Write a SQL statement to get the maximum purchase amount of all the orders
e) Write a SQL statement to find the highest purchase amount with their ID, for only those
customerswhose ID is within the range 3002 and 3007.

Note:
 If you submit your assignment after the given deadline Zero will be awarded to you.
 Copied assignment will be marked zero.
 Viva will be conducted for this assignment and on the basis of that your assignment
will be evaluated.
Faculty of Computing and Information Technology (FCIT)
Department of Computing Indus University, Karachi

NAME OF STUDENT: Muhammad Hassaan ID No: 1761-2021

Solution
Question 1: Solve the queries in SQL server given below by
following this table:

a) Write a query to produce a list of salesman_id, name, city and commision of each salesman who
live in cities other than Paris and Rome.

b) Write a SQL statement to find those salesmen with all other information and name started with
any letter within 'A' and 'K'.

c) Write a SQL statement to find all those customers with all information whose names are ending
withthe letter 'n'.
Faculty of Computing and Information Technology (FCIT)
Department of Computing Indus University, Karachi

d) Write a SQL statement to find those salesmen with all information who come from the city either
Parisor Rome.

e) Write a SQL statement to find those salesmen with all information who gets the commission
within arange of 0.12 and 0.14.

f) Write a SQL statement to find those salesmen with all information whose name containing the
1st character is 'N' and the 4th character is 'l' and rests may be any character.
Faculty of Computing and Information Technology (FCIT)
Department of Computing Indus University, Karachi
Question 2: Solve the queries in SQL server given below by following this table:
a) Write a SQL statement to find the average purchase amount of all orders.

b) Write a SQL statement to find the total purchase amount of all orders.

c) Write a SQL statement to get the minimum purchase amount of all the orders.

d) Write a SQL statement to get the maximum purchase amount of


all the orders

e) Write a SQL statement to find the highest purchase amount with their ID, for only those customers
whose ID is within the range 3002 and 3007.

You might also like