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

Assignment B.Sc. Computer Science: Batch 2017

This document contains an assignment submitted by 5 students - Usama Adeeb, Saim Ahmad, Ayesha Akhtar, Rifat Parveen, and Hammad Ali - to their supervisor Mam Kiran Amjad. The assignment was submitted as part of the B.Sc. Computer Science Batch 2017 program at Lahore Garrison University in Lahore, Pakistan. It contains SQL queries to calculate sum, max, min, average, and count values from data in an Employee table in a Company database.

Uploaded by

Usama Adeeb
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)
66 views3 pages

Assignment B.Sc. Computer Science: Batch 2017

This document contains an assignment submitted by 5 students - Usama Adeeb, Saim Ahmad, Ayesha Akhtar, Rifat Parveen, and Hammad Ali - to their supervisor Mam Kiran Amjad. The assignment was submitted as part of the B.Sc. Computer Science Batch 2017 program at Lahore Garrison University in Lahore, Pakistan. It contains SQL queries to calculate sum, max, min, average, and count values from data in an Employee table in a Company database.

Uploaded by

Usama Adeeb
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

Assignment

B.Sc. Computer Science


Batch 2017

Supervisor

Mam Kiran Amjad

Submitted By

Usama Adeeb FA-17-BSCS-138

Saim Ahmad FA-17-BSCS-388

Ayesha Akhtar FA-17-BSCS-076

Rifat Parveen FA-17-BSCS-436

Hammad Ali FA-17-BSCS-075

DEPARTMENT OF COMPUTER SCIENCE


FACULTY OF COMPUTER SCIENCE
LAHORE GARRISON UNIVERISTY

Lahore Garrison University


Defence Phase VI, LAHORE
Sum , Max , Min , Avg , Count

CREATE DATABASE Company

CREATE TABLE Employee


(
EmpID int PRIMARY KEY IDENTITY(1,1),
Name varchar(50) NULL,
Depr varchar(30),
Gender varchar(50),
Salary int,
city varchar(100),
)

insert into Employee values


('Ahmad','Chemical','Male',15000 ,'Lahore'),
('Ali','Computer','Male',25000 ,'Rawalpindi'),
('Usama','Accounts','Male',30000 ,'Lahore'),
('Saim','Accounts','Male',25000 ,'Lahore'),
('Aleena','Sales','female',10000 ,'Rawalpindi'),
('laiba','chemical','Female', 12500,'Rawalpindi'),
('Fakhir','Computer','Male',12499 ,'karachi'),
('Alia','Computer','Female',23500 ,'Karachi');

Select sum (salary) as 'Total Salary' , count (empid) as 'No of Employee' from Employee
Select city,Gender, sum (salary) as 'Total Salary' ,count (city) as 'No of Employee' from
Employee group by city,gender
Select gender , sum (salary) as 'Total Salary' from Employee group by Gender
Select depr, sum (salary) as 'Total Salary' from Employee group by depr
Select sum (salary) as 'Total Salary' from Employee
Select sum (salary) as 'Total Salary' ,count (empid) as 'No of Employee' from Employee
group by city

Select max(salary) from Employee


Select city , max(salary) as 'Max salary city wise 'from Employee group by city
Select city ,gender, max(salary) as 'city/gender wise' from Employee group by city
,gender
select depr,max(salary ) as 'dept wise ' from Employee group by depr

Select min(salary) as 'min ' from Employee


Select city , min(salary) as 'Min salary city wise 'from Employee group by city
Select city ,gender, min(salary) as 'city/gender wise' from Employee group by city
,gender
select depr,min(salary ) as 'dept wise ' from Employee group by depr

Select avg(salary) as 'Average' from Employee


Select city , avg(salary) as 'Average city wise 'from Employee group by city
Select city ,gender, avg(salary) as 'city/gender wise' from Employee group by city
,gender
select depr,avg(salary ) as 'dept wise ' from Employee group by depr

select count (salary) from Employee

select * from Employee

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy