Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Prop File 1 alter session set \"_oracle_script\"=true; Install PROP database you

ID: 2247064 • Letter: P

Question

Prop File 1
alter session set "_oracle_script"=true;

Install PROP database your local account. You need to submit two documents with the following instruction. Document 1: Every query should have the following format: o Query in English (as appear in this assignment) (Comment Query) o SQL statement Document 2: Result- top 10 rows from the generated SQL code 1. List of all cities where there is a branch but no properties 2. Find all staff who work in a Preston branch. 3. List branches and properties in same city and any unmatched branches or properties 4. Find number of properties handled by each staff member. 5. Find staff whose salary is larger than salary of at least one member of staff at branch B008. In class assignment - Bonus (4 points) 1. Produce a list of monthly salaries for all staff, showing staff number, first and last names, and salary details. 2. Find number of staff in each branch and their total salaries.

Explanation / Answer

1)

SELECT city FROM property_for_rent , lease

WHERE branchno is NULL

2)

SELECT * FROM staff

WHERE branchno In ( SELECT branchno FROM branch WHERE city="Preston" )

3)

SELECT FROM branch a, property_for_rent b , lease c WHERE a.branchno=b.branchno AND a.branchno=c.branchno GROUPBY a.city

4)

SELECT staffno,Count(staffno) as a from property_for_rent , staff

GROUPBY staffno

5)

SELECT FROM WHERE salary > ANY (SELECT salary FROM staff WHERE branchno = "B008" )