Creating Tables


Create tables using the CREATE TABLE statement

Specify a table name and column specifications

CREATE TABLE Product (
    ProductID INTEGER IDENTITY PRIMARY KEY, 
    Name VARCHAR(20), 
    Price DECIMAL NULL
);

Modify table definition using the ALTER TABLE statement

Add or remove columns, constraints, keys

ALTER TABLE Product 
    ADD Supllier INTEGER NOT NULL 
    CONSTRAINT def_supplier DEFAULT 1;

Remove tables using the DROP TABLE statement

Removes the table from the database

DROP TABLE Product;

results matching ""

    No results matching ""