From the Windows start menu click on SQL Server Management Studio. Login to the
ID: 3708152 • Letter: F
Question
From the Windows start menu click on SQL Server Management Studio.
Login to the database server.
From home enter:
For server type select Database Engine (which be the default).
At home your desktop or laptop will server as both the database client and the database server. For the server name enter the name of your desktop/laptop (it's probably filled in for you). You could also enter 127.0.0.1, which is the loop-back IP address that always points to your own machine.
At home select Windows Authentication.
You will not need to enter a user name or password. When you use Windows Authentication SQL Server uses the user name and password that you entered when you signed on to Windows.
n a SQL window in the appropriate database:
Click the plus sign next to Databases
Right click on the database you will be doing your homework in. At home it will be the database you created when setting up SQL Server. Never use the master database.
Click on New query
Run the following script to setup the Chicago parks tables:
Here is an ERD of the tables:
Write a single query that shows the all the Chicago parks that have at least two basketball courts, at least two football fields, and at least one outdoor pool. Order the results by the park's name. Include the following columns in your results:
Park's name
Number of basketball courts
Number of football fields
Number of outdoor pools
Region Description
Community Name
Screenshot #4: Chicago Parks Query
Explanation / Answer
/*Write a single query that shows the all the Chicago parks that have at least two basketball courts, at least two football fields,
and at least one outdoor pool.
Order the results by the park's name. Include the following columns in your results: Park's name ,Number of basketball courts
Number of football fields, Number of outdoor pools ,Region Description ,Community Name*/
SELECT c.ParkName,c.BasketballCourt,c.Football,c.PoolOutdoor,RegionDescription,CommunityName FROM ChicagoParks c
INNER JOIN ChicagoRegions cr ON c.Region=cr.Region
INNER JOIN ChicagoCommunities cc ON c.CommunityAreaNumber=cc.CommunityAreaNumber
WHERE c.BasketballCourt>=2 AND c.Football>=2 AND c.PoolOutdoor>=1
ORDER BY c.ParkName;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.