Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the WeatherDB Database and the Spokane2022 table provide SELECTs to: From the Weather database. Spokane2022 table, produce a SQL statement that generates a list

Using the WeatherDB Database and the Spokane2022 table provide SELECTs to:

From the Weather database. Spokane2022 table, produce a SQL statement that generates a list of

all data in the order of the primary key. SELECT statement:

Sort by Average Low highest to lowest. SELECT statement:

Include only the fields Month, Day, AvgLo SELECT statement:

Modify your output so that AVGLo reads AverageLow SELECT statement:

Modify the previous problem that produces that Average Low for todays date. Remove the ORDER BY clause since it is useless when 1 record is returned. SELECT statement:

Return all records but include only Month, Day, and Average High columns. Make the column header for the Average Hi read AverageHigh. Order the data in date order ascending. Include average hi temperatures greater than 50 degrees. Select statement:

Write a Select to list only the 5thday of each month. Include the columns Month, Day AvgHi, and AvgLo. Order the data in date order ascending. Select statement:

Return all records but include only Month, Day, and Record Low for all rows with Record Lows below freezing (below 32). Select statement:

Modify the previous SELECT to include Record Lows below freezing but only for January. Select statement:

Using the BaseBall Database and the Players and Batting tables:

Provide the name - namefirst, namelast, and weight of all players weighing more than 200 lbs in ascending name order (last name then first name). Select statement:

Write a select statement that will display the tallest players name and height in feet. Here is a hint, add the statement TOP 1 directly after your SELECT keyword and before your field list. Take note that the TOP clause is useless without an ORDER BY Clause.

Who?

SELECT statement

What is the weakness in using TOP when determining the person who is tallest (for example):

Take note that the TOP clause is useless without an ORDER BY Clause. Why?

List the legal names (name given plus last name) as FullName including proper spacing, and birth cities and state (as 1 column as BirthCity) for all players born in either Washington State or Idaho. (e.g., George Herman Ruth not Babe Ruth)

FullName BirthCity George Herman Ruth Baltimore, MD

Select statement:

Modify the previous problem WHERE to show those players that were born only in Spokane, WA. Keep in mind there may be more than one Spokane in the USA. Select statement:

Use the baseball Players table to locate the PlayerID for Willie Mays. Use a SELECT to find the record by name. Be careful not to pick an incorrect Willie (nameFirst), Mays(nameLast).

PlayerIDpk: ____________

Select statement:

Use the playerID from the previous SELECT to find all Willie Mays data in the batting table. Provide the SELECT statement.

Select statement: Problems 12-14 are worth 4 points total

Find the height of the shortest player displaying only the height column. Select statement:

Using WHERE, find out the name of the person of that height (WHERE HEIGHT = nnn) Select statement:

Replace the number (nnn) with parenthesis. Copy the statement from #12 into the parenthesis and execute it. You should now have a single statement that replaces two statements. Select statement:

Extra Credit: (2 points)

Produce your weather table's complete output in Celsius rather than Fahrenheit.

Select statement:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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