Task 9: The StayWell property management team wants to add two additional properties and run some simulation tests relating to market coverage. Add the following properties to the
I need help with Task 9.
I have Task 9 written out on the bottom but it isn't working.
Expected Results
Task 9:
The StayWell property management team wants to add two additional properties and run some simulation tests relating to market coverage. Add the following properties to the PROPERTY table:
Here is my formula so far.
TASK 1
SELECT
O.FIRST_NAME, O.LAST_NAME, P.ADDRESS
FROM
PROPERTY P
JOIN
OWNER O ON P.OWNER_NUM = O.OWNER_NUM
TASK 2
SELECT
PROPERTY_ID, ADDRESS
FROM
PROPERTY
WHERE
EXISTS( SELECT
PROPERTY_ID
FROM
SERVICE_REQUEST
WHERE
PROPERTY.PROPERTY_ID = SERVICE_REQUEST.PROPERTY_ID
AND CATEGORY_NUMBER = 1)
TASK 3
SELECT
*
FROM
OWNER
WHERE
OWNER_NUM IN (SELECT
OWNER_NUM
FROM
PROPERTY
WHERE
SQR_FT > 2000)
TASK 4
SELECT
*
FROM
SERVICE_REQUEST ST1
WHERE EXISTS (
SELECT * FROM SERVICE_REQUEST ST2
WHERE ST1.NEXT_SERVICE_DATE != ST2.NEXT_SERVICE_DATE
AND ST1.PROPERTY_ID = ST2.PROPERTY_ID)
TASK 5
SELECT
CONCAT(FIRST_NAME, SURNAME) AS PARTICIPANT
FROM
RESIDENTS
UNION SELECT
CONCAT(FIRST_NAME, LAST_NAME) AS PARTICIPANT
FROM
OWNER
TASK 6
SELECT
CONCAT(R.FIRST_NAME, R.SURNAME) AS NAME, P.ADDRESS AS ADDRESS
FROM
RESIDENTS R
JOIN
PROPERTY P ON R.PROPERTY_ID = P.PROPERTY_ID
TASK 7
ALTER TABLE RESIDENTS
MODIFY COLUMN RESIDENT_ID SMALLINT AUTO_INCREMENT;
NEW QUERY
DESCRIBE RESIDENTS
TASK 8
INSERT INTO RESIDENTS(RESIDENT_ID, FIRST_NAME, SURNAME, PROPERTY_ID) VALUES(40, 'Yigit', 'Yilmaz',13);
NEW QUERY
SELECT * FROM RESIDENTS WHERE FIRST_NAME = 'Yigit' AND RESIDENT_ID = '40'
TASK 9
INSERT INTO PROPERTY (PROPERTY_ID, OFFICE_NUM, ADDRESS, SQR_FT, BDRMS, FLOORS, OWNER_NUM) VALUES
(14, 1, '9 Houston Drive', 1100, 2, 1, 'MO100'),
(15, 1, '11 Village Drive', 1300, 3, 1, 'CO103');
NEW QUERY
SELECT * FROM PROPERTY
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images