Creating Queries

With all the preliminaries taken care of, you can roll up your sleeves and start writing SQL. The SQL statement you will use most is the SELECT statement. As its name implies, you use SELECT to select data from a table.

Most SELECT statements require at least the following two parameters:

  • What data you want to select, known as the select list. If you specify more than one item, you must separate each with a comma.

  • The table (or tables) from which to select the data, specified with the FROM keyword.

The first SQL SELECT you will create is a query for a list of movies in the Films table. Type the code in Listing 6.1 in the SQL Query box and then execute the statement by clicking the Execute button.

Listing 6.1. Simple SELECT Statement ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started 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.