Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. List the owner number, last name, and first name of every property owner. 2. List the complete PROPERTY table (all rows and all columns).

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1. List the owner number, last name, and first name of every property owner. 2. List the complete PROPERTY table (all rows and all columns). 3. List the last name and first name of every owner who lives in Seattle. 4. List the last name and first name of every owner who does not live in Seattle. 5. List the property ID and office number for every property whose square footage is equal to or less than 1,400 square feet. 6. List the office number and address for every property with three bedrooms. 7. List the property ID for every property with two bedrooms that is managed by StayWellGeorgetown. 8. List the property ID for every property with a monthly rent that is between $1,350 and $1,750. 9. List the property ID for every property managed by StayWeH-Columbia City whose monthly rent is less than $1,500. 10. Labor is billed at the rate of $35 per hour. List the property ID, category number, estimated hours, and estimated labor cost for every service request. To obtain the estimated labor cost, multiply the estimated hours by 35 . Use the column name ESTIMATED_COST for the estimated labor cost. 11. List the owner number and last name for all owners who live in Nevada (NV), Oregon (OR), or Idaho (ID). 12. List the office number, property ID, square footage, and monthly rent for all properties. Sort the results by monthly rent within the square footage. 13. How many three-bedroom properties are managed by each office? 14. Calculate the total value of monthly rents for all properties. \# Create OWNER table DROP TABLE IF EXISTS OWNER; CREATE TABLE OWNER ( OWNER NUM CHAR(5) PRIMARY KEY NOT NULL, LAST NAME VARCHAR(20) NOT NULL, FIRST NAME VARCHAR(20) NOT NULL, ADDRESS VARCHAR(10B) NOT NULL, CITY VARCHAR(20) NOT NULL, STATE CHAR(2) NOT NULL, ZIP CODE CHAR(5) NOT NULL ) \# Insert owners INSERT INTO OWNER VALUES('M0100', 'Moore', 'E1le-May', '8006 W. Newport Ave.' ' 'Reno', 'NV', '89508'); INSERT INTO OWNER VALUES('PA101', 'Ptel', 'Makesh', '7337 Sheffield St.', 'Seattle', 'WA ', '98119'); INSERT INTO OWNER VALUES( 'AK102', 'Aksoy', "Ceyda', '411 Griffin Rd. ', 'Seattle', 'WA', '98131'); INSERT INTO OWNER VALUES( 'CO103", 'Cole', 'Meerab', '9486 Circle Ave. ", 'Olympia", 'WA", "98506'"); INSERT INTO OWNER VALUES( "K0104", 'Kowalczyk', 'Jakub', '7431 S. Bishop St. ', 'Bellingham', 'WA', '98226') ; INSERT INTO OWNER VALUES('SI105', 'Sins', 'Haydon', '527 Primrose Rd. ', 'Portland', 'OR. , '97203'); INSERT INTO OWNER VALUES('BU106', 'Burke', 'Ernest', '613 01d Pleasant St.', 'Twin Falls', 'ID', '83303') INSERT INTO OWNER VALUES('RE107", 'Redman', 'Seth', '7681 Fordham St,', 'Seattle', 'WA", '98119'); INSERT INTO OWNER VALUES( "LO108', 'Lopez', 'Janine', '9856 Pumpkin Hil1 Ln. ', 'Everett ', 'WA', '98213'); INSERT INTO OWNER VALUES( BI109', 'Bianchi', 'Nicole', '7990 Willow Dr. ', 'New York', 'NY', "100e5') ; INSERT INTO OWNER VALUES('J0110", 'Jones", 'Ammarah', "730 Military Ave.', 'Seattle", "WA ', '98126"); \# Create PROPERTY table DROP TABLE IF EXISTS PROPERTY; CREATE TABLE PROPERTY ( PROPERTY ID SMALLINT PRIMARY KEY NOT NULL, OFFICE NUM TINYINT NOT NULL, ADDRESS VARCHAR(100) N NULL, SQR FT SMAUIINT NOT NULL, BDRMS TINYINT NOT NULL, FLOORS TINYINT NOT NULL, MONTHLY_RENT SMALLINT, OWNER NUM CHAR(5) NOT NULL ) \# Insert properties INSERT INTO PROPERTY VALUES(' 1;,1;,30 West Thomas Rd. ,1600,3,,1,1400, BU106 ); INSERT INTO PROPERTY VALUES (2,,1,782 Queen Ln. ,2100,4,2,1900, , AK102'); INSERT INTO PROPERTY VALUES (6,,1;,8 Laurel Dr. ,2125,,4,2,2050, MO100 ); INSERT INTO. PROPERTY VALUES (7,,2,447 Goldfield St. ,1675,3,2,1700,0,00103); \# Create office table DROP TABLE IF EXISTS OFFICE; CREATE TABLE OFFICE ( OFFICE NUM TINYINT PRIMARY KEY NOT NULL, OFFICE_ NAME VARCHAR(50) NOT NULL, ADORESS VARCHAR(108) NOT NULL, AREA VARCHAR(50) NOT NULL, CITY VARCHAR(20) NOT NULL, STATE CHAR(2) NOT NULL, ZIP_CODE CHAR(5) NOT NULL ); \# Insert offices INSERT INTO OFFICE VALUES("1', 'StayWell-Colombia City'; '1135 N. Wells Avenue', 'Colombia City', 'Seattle', 'WA', '98118'); INSERT INTO OFFICE VALUES('2',''StayNel1-Georgetown', '986 S. Madison Rd',' 'Georgetown', 'Seattle', 'WA', '98108'); * Create SERVICE_CATEGORY table DROP TABLE IF EXISTS SERVICE CATEGORY; CREATE TABLE SERVICE_CATEGORY ( CATEGORY_NUM TINYINT PRIMARY KEY NOT NULL, CATEGORY_DESCRIPTION VARCHAR(100) NOT NULL ); \# Insert service categories INSERT INTO SERVICE_CATEGORY VALUES("1", 'Pluabing'); IUSERT INTO SERVICE_CATEGORY VALUES (" 2 ', 'Heating'); INSERT INTO SERVICE_CATEGORY VALUES(' 3; ', Paintng'); ; INSERT INTO SERVICE_CATEGORY VALUES('A',' 'Electrical Systems''); INSERT INTO SERVICE_CATEGORY VALUES(' 5 ', 'Carpentry'); INSERT INTO SERVICE CATEGORY VALUES (' 6 ', ' 'Furniture replacement'"); \# Create RESIDENTS table DROP TABLE IF EXISTS RESIDENTS; CREATE TABLE RESIDENTS ( RESIDENT_ID SMALLINT PRIMARY KEY NOT NULL, FIRST_NAME VARCHAR(20) NOT NULL, SURNAME VARCHAR(20) NOT NULL, PROPERTY_ID SMALLINT NOT NULL ) \# Insert residents INSERT INTO RESIDENTS VALUES (2, 'Tariq ; 'Khan', 1); INSERT INTO RESIDENTS VALUES (3, , 'Ismail, , 'Sali b,); INSERT INTO RESIDENTS VALUES( 4, , 'Callen , Beck, 2 '); INSERT INTO RESIDENTS VALUES( 5, , 'Milosz 'Polansky', ' 2 ' ); INSERT INTO RESIDENTS VALUES (6, ' 'Ashanti ;, 'Lucas', ' 2 ' ); INSERT INTO RESIDENTS VALUES (7;; ' Randy ;, 'Woodrue', 22); INSERT INTO RESIDENTS VALUES (8, ' Aislinn ' , 'Lawrence ,33); INSERT INTO RESIDENTS VALUES( 9, ', Monique ', 'French', 3 '); INSERT INTO RESIDENTS VALUES( 10, 'Amara ', 'Dejsuwan ', 4 '); INSERT INTO RESIDENTS VALUES( 12 ', 'Rosalie ', 'Blackmore ' , ' 4 '); INSERT INTO RESIDENTS VALUES( 13;, ' Carina ,'Britton', ' 4 ); INSERT. INTO RESIDENTS VALUES (114; ' Valentino ; ; Ortega, 5 '); INSERT INTO RESIDENTS VALUES ( ' 15 ', 'Kaylem ', 'Kent', '5'); INSERT INTO RESIDENTS VALUES(' 16 ', 'Alessia ', 'Wagner', ' 6 ' ); INSERT INTO RESIDENTS VALUES( 17;, ' 'Tyrone ; ; 'Galvan ', ' 6 ' ); INSERT INTO. RESIDENTS VALUES ( 18, ', Constance ; ' Fleming ,6 '); INSERT INTO RESIDENTS VALUES ( ' 19, ' 'Eamonn ',' Bain', 6 '); INSERT INTO RESIDENTS VALUES( 200, 'Misbah ', 'Yacob', '7'); INSERT INTO RESIDENTS VALUES( 21, " Gianluca ', 'Esposito ,7 ' ); INSERT INTO RESIDENTS VALUES ( 22; ', Elinor ; ; 'Lake, 77); INSERT INTO RESIDENTS VALUES( 22 ', ' Ray ', ' Rosas ; 8); INSERT INTO RESIDENTS VALUES ( 24, ' Damon " ; 'Caldwell 1,8); INSERT INTO RESIDENTS VALUES ( 25, ' 'Dawood ; 'Busby, 88); INSERT INTO RESIDENTS VALUES (266 ' 'Dora 'Harris .8)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions