CS 3743 The University of Texas at San Antonio SQL SELECT Statement Database

User Generated

Oevna1030_

Programming

CS 3743

The University of Texas at San Antonio

CS 3743

Description

Please show an appropriate SQL SELECT statement to answer each of the following. Some of the problems will require nested SELECT statements (due to NOT EXISTS). You may also get up to 5 points of extra credit (total) by using the mysql command line utility to run your queries and paste the results into your solution for each question. See the sample output below.

Unformatted Attachment Preview

CS3743 Hwk#5 SQL (30 pts, Due: TUESDAY Nov 24, 2020) Customer(custNr, name, baseLoc,birthDt, gender) Property (propId, locDesc, state, propType, ra
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached. Please let me know if you have any questions or need revisions.

1. Find the propId, locDesc, and state for properties with a propType equal to "T"
(i.e., traditional)
Sql Statement
SELECT propId,locDesc,state
FROM property
WHERE propType = "T";
Screenshot

2. Find the propId and startDt for properties which the customer named Ava
Kashun has a rental.
Sql Statement
SELECT r.propId, r.startDt
FROM rental AS r
WHERE EXISTS (SELECT c.name FROM customer AS c WHERE r.custNr = c.custNr AND c.name
= "Ava Kashun")

Screenshot

3. Find the property ID and locDesc of properties in TX (state) which have a start
date after "2019-11-03" for the customer named "Perry Scope".
SQL Statement

SELECT p.propId, p.locDesc
FROM property AS p, rental AS r,customer AS c
WHERE p.propId = r.propId AND r.custNr = c.custNr...


Anonymous
I was stuck on this subject and a friend recommended Studypool. I'm so glad I checked it out!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags