©  Rahul Batra 2018
Rahul BatraSQL Primerhttps://doi.org/10.1007/978-1-4842-3576-8_5

5. Writing Basic Queries

Rahul Batra1 
(1)
Gurgaon, Haryana, India
 

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.

Database administration tasks for a well thought-out schema are few and far between, but retrieving ...

Get SQL Primer: An Accelerated Introduction to SQL Basics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.