Database Reference
In-Depth Information
CREATE TABLE
Use the CREATE TABLE command to create a table by describing its layout. Figure B-3 describes the
CREATE TABLE command.
350
Clause
Description
Required?
CREATE TABLE table name
Indicates the name of the table to be created.
Yes
(column and data type list)
Indicates the columns that make up the table along with their
corresponding data types (see the “Data Types” section).
Yes
FIGURE B-3
CREATE TABLE command
The following CREATE TABLE command creates the Rep table and its associated columns and data types:
CREATE TABLE Rep
(RepNum CHAR(2),
LastName CHAR(15),
FirstName CHAR(15),
Street CHAR(15),
City CHAR(15),
State CHAR(2),
Zip CHAR(5),
Commission DECIMAL(7,2),
Rate DECIMAL(3,2) )
;
Access version:
CREATE TABLE Rep
(RepNum CHAR(2),
LastName CHAR(15),
FirstName CHAR(15),
Street CHAR(15),
City CHAR(15),
State CHAR(2),
Zip CHAR(5),
Commission CURRENCY,
Rate NUMBER )
;
t have a DECIMAL data type. To create numbers
with decimals, you must use either the CURRENCY or NUMBER data type. Use the CURRENCY data type for
fields that will contain currency values; use the NUMBER data type for all other numeric fields.
Note: Unlike other SQL implementations, Access doesn
'
CREATE VIEW
Use the CREATE VIEW command to create a view. Figure B-4 describes the CREATE VIEW command.
Clause
Description
Required?
CREATE VIEW view name AS
Indicates the name of the view to be created.
Yes
query
Indicates the deining query for the view.
Yes
FIGURE B-4
CREATE VIEW command
Search WWH ::




Custom Search