I have no experience in SQL and I just need a little assistant on what to do wri
ID: 3846190 • Letter: I
Question
I have no experience in SQL and I just need a little assistant on what to do writing the code.Homework One: Chapter Three COLUMN LOCATION NUM DECIMAL BIORMS SMALLINTI of bedrooms BATH SMALLINT No of bathrooms Monthly condo 1.Create a LARGE CONDO table with the structure shown above. 2. Insert into the LARGE CONDO table the location number, unit number, bedrooms, baths, condo fee and owner number for those condos whose square footage is greater than l,500 square feet. NOTE: Look at the data in the CONDO UNIT table (attached to this homework assignment) to find the values for condos whose square footage is greater than 1,500) 3. Somaris has increased the condo fee of each large condo by $150. Update the condo fees in the LARGE CONDO table accordingly. After increasing the condo fee ofeach large condo by S150, Somaris decides to decrease the condo fee of any condo whose monthly fee is more than S750 by one percent. Update the condo fees in the LARGE CONDO table accordingly. 5. Insert a row into the LARGE CONDO table for a new condo. The location number is l, the unit number is 605, the number of bedrooms is 3, the number of bathrooms is 3, the condo fee is S775, and the owner number if FE182 6. Delete the condos in the LARGE CONDO table for each the owner number is AN175 7,7. The condo in location and unit 503 is in the process of being remodeled and the number of bedrooms is unknown. Change the bedrooms value in the LARGE CONDO table to null.
Explanation / Answer
_______________________________________________________________________________
1.
CREATE TABLE LARGE_CONDO ( LOCATION_NUM DECIMAL(2) NOT NULL,
UNIT_NUM CHAR(3) NOT NULL,
BDRMS SMALLINT ,
BATH SMALLINT,
CONDO_FEE DECIMAL(6,2),
OWNER_NUM CHAR(5),
PRIMARY KEY(LOCATION_NUM, UNIT_NUM)
);
___________________________________________________________________________________________
2. Rerer to CONDO_UNIT table (not attached here) and use the following syntax to insert the values.
INSERT INTO LARGE_CONDO VALUES (location num, unit num, bedrooms, baths, monthly fee, owner);
Insert those values for which the condo fee is more than 1500.
_______________________________________________________________________________________________
3.
UPDATE LARGE_CONDO
SET CONDO_FEE = CONDO_FEE + 150.00;
______________________________________________________________________________________________
4.
UPDATE LARGE_CONDO
SET CONDO_FEE = CONDO_FEE + (CONDO_FEE / 100)
WHERE CONDO_FEE > 750.00;
_____________________________________________________________________________________________
5.
INSERT INTO LARGE_CONDO VALUES (1, 605, 3, 3, 775, FE182);
_______________________________________________________________________________________________
6.
DELETE FROM LARGE_CONDO
WHERE OWNER_NUM = AN175;
_______________________________________________________________________________________________
7.
UPDTAE LARGE_CONDO
SET BDRMS = null
WHERE LOCATION_NUM = 1 and UNIT_NUM = 503;
_______________________________________________________________________________________________
8.
ALTER TABLE LARGE_CONDO ADD OCCUPIED CHAR(1);
UPDATE LARGE_CONDO
SET OCCUPIED = 'Y';
______________________________________________________________________________________________
9.
UPDATE LARGE_CONDO
SET OCUPIED = 'N'
WHERE UNIT_NUM = C06;
______________________________________________________________________________________________
10.
ALTER TABLE LARGE_CONDO MODIFY COLUMN CONDO_FEE DECIMAL(6,2) NOT NULL;
_______________________________________________________________________________________________
11.
DROP TABLE LARGE_CONDO;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.