0% found this document useful (0 votes)
29 views6 pages

Assignment: Database Management System (Practical)

The document contains an assignment for a Database Management System practical. It includes multiple SQL queries to retrieve data from various tables in a property rental database. The queries select, filter, group, count, sum and order data on fields like staff details, property listings, viewings and more. The assignment asks the student to write additional queries to analyze staffing levels and properties by branch, list client names and comments, and show staff, branches and managed properties.
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)
29 views6 pages

Assignment: Database Management System (Practical)

The document contains an assignment for a Database Management System practical. It includes multiple SQL queries to retrieve data from various tables in a property rental database. The queries select, filter, group, count, sum and order data on fields like staff details, property listings, viewings and more. The assignment asks the student to write additional queries to analyze staffing levels and properties by branch, list client names and comments, and show staff, branches and managed properties.
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/ 6

ASSIGNMENT

Database Management System(Practical)


Name : B.M.T.Sadaruwan
Reg.No : 16GES882

a) (1)
SELECT *
FROM Staff;

(2)
SELECT Staff_No,fName,lName,Salary
FROM Staff;

(3)
SELECT DISTINCT Property_No
FROM Viewing;
(4)
SELECT Staff_No,fName,lName,Salary
FROM Staff;

b)
(1)
SELECT * FROM Staff
WHERE Salary>10000;

(2)
SELECT Addrss
FROM PrivateOwner
Where London or Glasgow ;
c) (1)
SELECT *
FROM Staff
WHERE Salary BETWEEN 20000 AND 30000;

(2) SELECT *
FROM Staff
WHERE Position='Manager' AND 'Supervisor' ;

d) (1) SELECT *
FROM PropertyForRent
WHERE City='Glasgow’;

e) (1) SELECT *
FROM Viewing
Where Property_No='PG4' AND Comment IS NULL;
f) (1) SELECT*
FROM Staff
ORDER BY Salary DESC;

(2)

g) (1) SELECT COUNT (Rent)


FROM PropertyForRent
WHERE Rent > 350;

(2)
SELECT Count(ViewDate)
FROM Viewing
WHERE (((Viewing.[ViewDate]) Between #5/1/2001# And #5/31/2001#));

(3)
SELECT COUNT(Position)
FROM Staff
WHERE Position='Manager';

SELECT SUM(Salary)
FROM Staff
WHERE Position='Manager';
(4) SELECT MIN(Salary)
FROM Staff;

SELECT AVG(Salary)
FROM Staff;

h) (1)

(2) Write a SQL query to list each branch office with more than one member of staff; find the
number of staff working in each branch and the sum of their salaries.

(1) write a SQL query to list the names of all clients who have viewed a property along with
any comment supplied.

(2) Write a SQL query for each branch; list the numbers and names of staff who manage
properties, including the city in which the branch is located and the properties that the staff
manage.

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