Database Reference
In-Depth Information
C
APPENDIX
HOW DO I? REFERENCE
This appendix answers frequently asked questions about how to accomplish a variety of tasks using SQL. Use
the second column to locate the correct section in Appendix B that answers your question.
How do I?
Review the Named Section(s) in Appendix B
Add columns to an existing table?
ALTER TABLE
Add rows?
INSERT
Calculate a statistic (sum, average,
1. SELECT
maximum, minimum, or count)?
2. Column or Expression List (SELECT clause)
(Use the appropriate function in the query.)
Change rows?
UPDATE
Create a data type for a column?
1. Data Types
2. CREATE TABLE
Create a table?
CREATE TABLE
Create a view?
CREATE VIEW
Create an index?
CREATE INDEX
Delete a table?
DROP TABLE
Delete an index?
DROP INDEX
Delete rows?
DELETE Rows
Drop a table?
DROP TABLE
Drop an index?
DROP INDEX
Grant a privilege?
GRANT
Group data in a query?
SELECT
(Use a GROUP BY clause.)
Insert rows using a query?
SELECT INTO
Insert rows?
INSERT
Join tables?
Conditions
(Include a WHERE clause to relate the tables.)
Order query results?
SELECT
(Use an ORDER BY clause.)
Remove a privilege?
REVOKE
Remove rows?
DELETE Rows
Retrieve all columns?
1. SELECT
2. Column or Expression List (SELECT clause)
(Type * in the SELECT clause.)
Retrieve all rows?
SELECT
(Omit the WHERE clause.)
FIGURE C-1
How do I? reference
(continued)
Search WWH ::




Custom Search