Let's get straight down to business.
We'll start with the most often used statement:
THE SELECT STATEMENT:
Basic syntax:
SELECT column_name(s) |
--------------------------------------
For example (using the table Products in the previous post):
SELECT prod_name |
Will return :
--------------------------------------
Or we can retrieve multiple columns such as:
SELECT prod_name, prod_price |
and you'll get:
--------------------------------------
Or you can use wildcards and retrieve all the columns:
SELECT * |
and you'll see:
In SQL, spaces don't count, and Enter presses don't either. Meaning that you can type:
SELECT * FROM Products
and get the same results.
Next we will discuss the WHERE clause. Before that, I will post instructions on how to open the database in Microsoft Access and send it SQL queries.
No comments:
Post a Comment