QUERYING THE DATABASE:  QUERIES and VIEWS

 

            Query:  Statement that allows data retrieval

            View:  A virtual table; a saved query (the SELECT statement, not the result)

           

 


SELECT statement (DML)

 

- retrieves a limited set of data from one or more tables using criteria specified in the WHERE clause

- often used to perform calculations on the data selected

- the result set is displayed as a table (columns and rows)

 

Single-table example (review): 

 

Current Product List:  all data comes from the Products table

 



SYNTAX

 

            SELECT column list

            FROM tablename

            WHERE criteria

            ORDER BY column list