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

Assignment: Database Management System (Practical)

The document contains a database management system assignment with multiple parts asking the student to write SQL queries to retrieve information from various tables in a database. The tables include Staff, PrivateOwner, PropertyForRent, Viewing. The questions ask the student to SELECT, COUNT, SUM, MIN, AVG various columns from the tables and apply WHERE clauses with conditions like BETWEEN, IS NULL, >, AND and ORDER BY.
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)
55 views5 pages

Assignment: Database Management System (Practical)

The document contains a database management system assignment with multiple parts asking the student to write SQL queries to retrieve information from various tables in a database. The tables include Staff, PrivateOwner, PropertyForRent, Viewing. The questions ask the student to SELECT, COUNT, SUM, MIN, AVG various columns from the tables and apply WHERE clauses with conditions like BETWEEN, IS NULL, >, AND and ORDER BY.
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/ 5

ASSIGNMENT

Database Management System(Practical)

Name :
Reg.No :
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