A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 1, Problem 8CAT
Program Plan Intro
SELECT statement:
It is used to retrieve information from the table or
Syntax:
SELECT * FROM table_Name;
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
he Horse table has the following columns:
ID - integer, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Write a SELECT statement to select the registered name, height, and birth date for only horses that have a height between 15.0 and 16.0 (inclusive) or have a birth date on or after January 1, 2020.
The Horse table has the following columns:
ID - integer, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Write a SELECT statement to select the registered name and height for only horses that have an above average height. Order the results by height (ascending).
The Horse table has the following columns:
ID - integer, primary key
RegisteredName - variable-length string
Breed - variable-length string
Height - decimal number
BirthDate - date
Write a SELECT statement to select the registered name and height for only horses that have an above average height. Order the results by height (ascending).
Hint: Use a subquery to find the average height.
Chapter 1 Solutions
A Guide to SQL
Ch. 1 - Prob. 1TDCh. 1 - Prob. 2TDCh. 1 - Prob. 3TDCh. 1 - Prob. 4TDCh. 1 - Prob. 5TDCh. 1 - Prob. 6TDCh. 1 - Prob. 7TDCh. 1 - Prob. 8TDCh. 1 - Prob. 9TDCh. 1 - Prob. 10TD
Ch. 1 - Prob. 11TDCh. 1 - Prob. 1CATCh. 1 - Prob. 2CATCh. 1 - Prob. 3CATCh. 1 - Prob. 4CATCh. 1 - Prob. 5CATCh. 1 - Prob. 6CATCh. 1 - Prob. 7CATCh. 1 - Prob. 8CATCh. 1 - Prob. 9CATCh. 1 - Prob. 10CATCh. 1 - Prob. 11CATCh. 1 - Prob. 12CATCh. 1 - Prob. 13CATCh. 1 - Prob. 14CATCh. 1 - Prob. 1SCGCh. 1 - Prob. 2SCGCh. 1 - Prob. 3SCGCh. 1 - Prob. 4SCGCh. 1 - Prob. 5SCGCh. 1 - Prob. 6SCGCh. 1 - Prob. 7SCGCh. 1 - Prob. 8SCGCh. 1 - Prob. 9SCGCh. 1 - Prob. 10SCGCh. 1 - Prob. 11SCGCh. 1 - Prob. 12SCGCh. 1 - Prob. 13SCG
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Create a Movie table with the following columns: ID - positive integer with maximum value of 50,000 Title - variable-length string with up to 50 characters Rating - fixed-length string with 4 characters ReleaseDate - date Budget - decimal value representing a cost of up to 999,999 dollars, with 2 digits for centsarrow_forwardList the first name and last name of all authors. Concatenate the first and last names so that the result set has only one column. Hint: CONCAT(). For example: +---------------+ | Full Name | +---------------+ | Mike Lance | | Steve Smith | | Anne Penny | | Ron MacDonald | | Sylvia Parry | | Albert Jones | +---------------+arrow_forwardThe Horse table has the following columns: ID - integer, auto increment, primary key RegisteredName - variable-length string Breed - variable-length string, must be one of the following: Egyptian Arab, Holsteiner, Quarter Horse, Paint, Saddlebred Height - decimal number, must be ≥ 10.0 and ≤ 20.0 BirthDate - date, must be ≥ Jan 1, 2015 Make the following updates: Change the height to 15.6 for horse with ID 2. Change the registered name to Lady Luck and birth date to May 1, 2015 for horse with ID 4. Change every horse breed to NULL for horses born on or after December 22, 2016.arrow_forward
- યુનિક્ ડેટાarrow_forwardThe Book table has the following columns: ID Title Author Genre Year Price Complete the SELECT statement to select the genre and the total number of books for that genre. SELECT /* Type your code here */ FROM Book GROUP BY Pick ✓arrow_forwardHow do you indicate that a column alias should be used?arrow_forward
- Add a new customer row by using the sequence created in Question 1. The only data currently available for the customer is as follows: last name = Shoulders, first name = Frank, and zip = 23567.arrow_forwardAdd a new row in the ORDERS table with the following data: Order# = 1022, Customer# = 2000, and Order date = August 6, 2009. Describe the error raised and what caused the error.arrow_forwardAdd a new row in the ORDERS table with the following data: Order# = 1021, Customer# = 1009, and Order date = July 20, 2009.arrow_forward
- Add the following row to the ADVENTURE_TRIP table: trip ID: 45; trip name: Jay Peak; Start location: Jay; state: VT; distance: 8; maximum group size: 8; type: Hiking and season: Summer. Display the contents of the ADVENTURE_TRIP table.arrow_forwardCreate a list of each book title stored in the BOOKS table and the category in which each book belongs. Reverse the sequence of the columns so that the category of each book is listed first.arrow_forwardList all information for each order item. Include an item total, which can be calculated by multiplying the Quantity and Paideach columns. Use a column alias for the calculated value to show the heading Item Total in the output.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- A Guide to SQLComputer ScienceISBN:9781111527273Author:Philip J. PrattPublisher:Course Technology PtrCOMPREHENSIVE MICROSOFT OFFICE 365 EXCEComputer ScienceISBN:9780357392676Author:FREUND, StevenPublisher:CENGAGE L
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage