Professional Documents
Culture Documents
Objective:
To understand the different issues involved in the design and
implementation of a database system
To understand and use data definition language to write query for a
database
1. CREATE:
Syntax:
Example:
The SQL CREATE TABLE statement is used to create a new relation (table)
Syntax:
Example:
(c)DESC command:
You can verify if your table has been created successfully by looking at the
message displayed by the SQL server, otherwise you can use the DESC command
as follows:
2. ALTER:
a. ALTER TABLE ...ADD... : This is used to add some extra fields into
existing relation.
Syntax:
ALTER TABLE table_name
ADD column_name1 column-definition,
column_name2 column-definition,
…...
column_n column_definition);
Example:
Syntax:
ALTER TABLE table_name
ALTER COLUMN column_name column_type;
Example:
Syntax:
Example:
3. DROP:
The SQL DROP DATABASE statement is used to drop an existing database in
SQL schema.
Syntax:
************************************