0% found this document useful (0 votes)
39 views

Data Definition Language: CREATE Statements

A data definition language (DDL) defines data structures like database schemas using a syntax similar to programming languages. DDL statements like CREATE, DROP, and ALTER are used to respectively make, remove, and modify database objects such as tables, indexes, and stored procedures. CREATE statements define new objects, DROP removes existing objects, and ALTER changes the properties of objects.

Uploaded by

Akhil Madavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Data Definition Language: CREATE Statements

A data definition language (DDL) defines data structures like database schemas using a syntax similar to programming languages. DDL statements like CREATE, DROP, and ALTER are used to respectively make, remove, and modify database objects such as tables, indexes, and stored procedures. CREATE statements define new objects, DROP removes existing objects, and ALTER changes the properties of objects.

Uploaded by

Akhil Madavan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Data definition language

A data definition language or data description language (DDL) is a syntax similar to a


computer programming language for defining data structures, especially database schemas.

CREATE statements

Create - To make a new database, table, index, or stored procedure.

A CREATE statement in SQL creates an object in a relational database management system


(RDBMS). In the SQL 1992 specification, the types of objects that can be created are
schemas, tables, views, domains, character sets, collations, translations, and assertions. Many
implementations extend the syntax to allow creation of additional objects, such as indexes
and user profiles. Some systems (such as PostgreSQL) allow CREATE, and other DDL
commands, inside a transaction and thus they may be rolled back.

DROP statements

Drop - To destroy an existing database, table, index, or view.

A DROP statement in SQL removes an object from a relational database management system
(RDBMS). The types of objects that can be dropped depends on which RDBMS is being
used, but most support the dropping of tables, users, and databases. Some systems (such as
PostgreSQL) allow DROP and other DDL commands to occur inside of a transaction and thus
be rolled back. The typical usage is simply:

DROP objecttype objectname.

For example, the command to drop a table named employees would be:

DROP employees;

ALTER statements

Alter - To modify an existing database object.

An ALTER statement in SQL changes the properties of an object inside of a relational database
management system (RDBMS). The types of objects that can be altered depends on which
RDBMS is being used. The typical usage is:

ALTER objecttype objectname parameters.

For example, the command to add (then remove) a column named bubbles for an existing
table named sink would be:

ALTER TABLE sink ADD bubbles INTEGER;


ALTER TABLE sink DROP COLUMN bubbles;

You might also like