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

Use the Condo Unit Table attached l. For every condo, list the location number,

ID: 3849005 • Letter: U

Question

Use the Condo Unit Table attached l. For every condo, list the location number, unit number, condo fee, owner number, owner's first name and owner's lat name. 2. For every completed or open service request for janitorial work, list the condo ID, description and status 3. For every service request for janitorial work, list the condo ID, location number, unit number, estimated hours, spent hours, owner number and owner's last name 4. List the square footage, owner number, owner last name, and owner first name for each condo in location number 1 s. List the square footage, owner number, owner last name, and owner first name for each condo in location number 1. Include only those condos with three bedrooms 6. List the list the location number, unit number and condo fee for condos whose owners live in Bowton or own a one-bedroom condos 7. List the location number, unit number, and condo fee for condos whose owners live in Bowton and own a one bedroom condo 8. List the location number unit number and condo fee for condos whose owners live in Bowton but do not own one bedroom condos 9. List the condo ID, square footage, owner number, service ID, number of estimated hours and number of spent hours for each service request 10, List the condo ID, square footage, owner number, service ID, number of estimated hours and number of spent hours for each service request on which the category number is 4

Explanation / Answer


Query 1 :
--------------
SELECT
A.CONDO_ID,
A.LOCATION_NUM,
A.UNIT_NUM,
A.CONDO_FEE,
A.OWNER_NUM,
B.FIRST_NAME,
B.LAST_NAME
FROM
CONDO_UNIT as A LEFT JOIN OWNERS as B
ON
A.OWNER_NUM = B.OWNER_NUM

Query 2:
-------------
SELECT
CONDO_ID,DESCRIPTION,STATUS
FROM
SERVICE_REQUEST
WHERE
STATUS IN ('Completed', 'Open') AND
CATEGORY_NUM IN ( SELECT CATEGORY_NUM FROM SERVICE_CATEGORY WHERE CATEGORY_DESCRIPTION = 'janitorial' ) ;

Query 3:
---------
SELECT
S.CONDO_ID,
S.EST_HOURS,
S.SPENT_HOURS,
C.LOCATION_NUM,
C.UNIT_NUM,
C.OWNER_NUMBER,
O.LAST_NAME
FROM
CONDO_UNIT as C,
OWNERS as O,
SERVICE_REQUEST as S
WHERE
S.CONDO_ID = C.CONDO_ID AND
C.OWNER_NUM = O.OWNER_NUM
S.CATEGORY_NUM IN ( SELECT CATEGORY_NUM FROM SERVICE_CATEGORY WHERE CATEGORY_DESCRIPTION = 'janitorial' )

Query 4 :
--------------
SELECT
C.SQR_FOOT,
C.OWNER_NUM,
O.LAST_NAME,
O.FIRST_NAME,
FROM
CONDO_UNIT as C,
OWNERS as O
WHERE
C.OWNER_NUM = O.OWNER_NUM AND
C.LOCATION_NUM = 1;


Query 5 :
-----------
SELECT
C.SQR_FOOT,
C.OWNER_NUM,
O.LAST_NAME,
O.FIRST_NAME,
FROM
CONDO_UNIT as C,
OWNERS as O
WHERE
C.OWNER_NUM = O.OWNER_NUM AND
C.LOCATION_NUM = 1,
C.BDROOMS = 3

Description :
--------------------
1. As per the Chegg policy i need to solve first 4 question. For rest of the question you need to upload the same question again. I am providing 5 solutions here.

2. I have used left join in first query which means query will return as much as records as output as available in left side table i.e in first query case CONDO_UNIT table is our left hand side table.

3. It might be possible that query gives you syntex error. if it happens then let me know the actual database name on which you are working with the error details so that i can make the correction and provide the right query,

You can get the syntax error just because of Db behaviour. Few database are case sensitive and others are not.

4. Let me know if you face any problem to make understanding on above given queries.I will solving your problems.

Thanks