©  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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.