SQL.ht1.jpg (2484 bytes)

The Database Programming Language -- SQL

SELECT Example


Click below to go directly to a specific section:
Description | Source Code | Sample Run


Description

This program create a standard SELECT statement and adding more clauses with the statement.


Source Code

1. Create a standard SELECT statement
SELECT * FROM employees
WHERE state = ‘CA’
2. Run that statment to test it
3. Add the words: CREATE VIEW viewname AS to the top of the select statement and run it
CREATE VIEW cal_employees AS
SELECT * FROM employees
WHERE state = ‘CA’
4. To use the view
INSERT cal_employees 
VALUES(100, ‘fred’, ‘smith’) etc.
DELETE cal_employees 
WHERE city = ‘Oakland’

[Back] [Home]


Last modified: 01:30 PM on 11/25/1996