Abstract
A query is an SQL statement that is used to extract a subset of data from your database and presents it in a readable format. As we have seen previously, the SELECT command is used to run queries in SQL. You can further add clauses to your query to get a filtered, more meaningful result. The level of flexibility afforded by SQL is one of the reasons it has succeeded as a query language. While there is an entire gamut of add-ons to SELECT, in this chapter we will focus on only two – ORDER BY and WHERE.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
If we let go of our from a table requirement, we can write a query with just SELECT. Try SELECT 1 in your DBMS and see the output.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Rahul Batra
About this chapter
Cite this chapter
Batra, R. (2018). Writing Basic Queries. In: SQL Primer. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3576-8_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3576-8_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3575-1
Online ISBN: 978-1-4842-3576-8
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books