0% found this document useful (0 votes)
68 views5 pages

Mis 205-New

1) The document contains the results of 10 sample queries run on an Employee database table. Each query result is labeled Query1 through Query10. 2) The queries select, filter, group and perform calculations like averages and maximums on different columns of the Employee table like name, salary, city, and department number. 3) Key results include listing employees by name and location, calculating total salary, grouping employees by department and salary averages, and filtering for employees within a certain salary range or city.

Uploaded by

api-420514891
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views5 pages

Mis 205-New

1) The document contains the results of 10 sample queries run on an Employee database table. Each query result is labeled Query1 through Query10. 2) The queries select, filter, group and perform calculations like averages and maximums on different columns of the Employee table like name, salary, city, and department number. 3) Key results include listing employees by name and location, calculating total salary, grouping employees by department and salary averages, and filtering for employees within a certain salary range or city.

Uploaded by

api-420514891
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

MIS 205

Class Work

Result 01:

Query1
BDate Address City State
731 Fondren Houston TX

Query 01:

SELECT [Employee].[BDate], [Employee].[Address], [Employee].[City], [Employee].[State]

FROM Employee

WHERE ((([Employee].[Fname])="John") And (([Employee].[Lname])="Smith"));

Result 02:

Query2
EmployeeID Fname Lname Bdate Address City State Sex Salary Supervisor ID DNo
123456789 John Smith 731 Fondren Houston TX M 30000 333445555 5
333445555 Franklin Won 12/8/1954 638 Voss Houston TX M 40000 888665555 5
453453453 Jouce English 7/31/1962 5631 Rice Houston TX F 25000 333445555 5
666884444 Ramesh Narayan 9/15/1952 975 Fire Oak Humble TX M 38000 333445555 5
888665555 James Borg 11/10/2027 450 Stone Houston TX M 5000 1
987654321 Jennifer Wallace 6/20/1931 291 Berry Bellaire TX F 43000 888665555 4
987987987 Ahmed Jabbar 3/29/1959 980 Dallas Houston TX M 25000 987654321 4
999887777 Alicia Zelaya 7/19/1958 3321 Castle Spring TX M 25000 987654321 1

Query 02:

SELECT *

FROM Employee;
Result 03:

Query3
Fname Lname Salary
John Smith 30000
Franklin Won 40000
Jouce English 25000
Ramesh Narayan 38000
James Borg 5000
Jennifer Wallace 43000
Ahmed Jabbar 25000
Alicia Zelaya 25000

Query 03:

SELECT [Fname], [Lname], [Salary]

FROM Employee;

Result 04:

Query4
Total_Salary
231000

Query 04:

SELECT SUM([Salary]) AS Total_Salary

FROM Employee;
Result 05:

Query5
Dnumber EmployeeID DNo MgrID Salary
5 123456789 5 333445555 30000
5 333445555 5 333445555 40000
5 453453453 5 333445555 25000
5 666884444 5 333445555 38000
1 888665555 1 888665555 5000
4 987654321 4 987654321 43000
4 987987987 4 987654321 25000
1 999887777 1 888665555 25000

Query 05:

SELECT Department.Dnumber, Employee.EmployeeID, Employee.DNo, Department.MgrID,


Employee.Salary

FROM Department INNER JOIN Employee ON Department.Dnumber = Employee.DNo;

Result 06:

Query6
DNo Expr1001
1 15000
4 34000
5 33250

Query 06:

SELECT [DNo], avg([Salary])

FROM Employee

GROUP BY [Dno]
Result 07:

Query7
DNo Expr1001
4 34000
5 33250

Query 07:

SELECT [DNo], avg([Salary])

FROM Employee

GROUP BY [DNo]

HAVING avg(Salary)>20000;

Result 08:

Query8
Expr1000 DNo
25000 1
43000 4
40000 5

Query 08:

SELECT max([Salary]), [DNo]

FROM Employee

GROUP BY [DNo]

Result 09:

Query9
Fname Lname City Salary
Ramesh Narayan Humble 38000
Query 09:

SELECT [Fname], [Lname], [City], [Salary]

FROM Employee

WHERE Salary>=30000 AND City="Humble";

Result 10:

Query10
EmployeeID Fname Lname City Salary
123456789 John Smith Houston 30000
333445555 Franklin Won Houston 40000
666884444 Ramesh Narayan Humble 38000

Query 10:

SELECT EmployeeID, Fname, Lname, City, Salary

FROM Employee

WHERE Salary BETWEEN 30000 AND 40000;

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