DDL(Data definition language):
(Oprations on table)
A data definition language is a syntax for
defining data structures, especially database.
Common DDL statements are CREATE, ALTER,
RANAME,DROP AND TRUNCATE.
• Must begin with a letter
• Can be 1-30 characters long
• Must contain only A-Z,a-z,0-9,_,$,and #
• Must not duplicate the name of another
object owned by the same user
• Must not be an oracle serve reserved word
1:CREATE TABLE
2:ALTER TABLE
3:RENAME TABLE
4:DROP TABLE
5:TRUNCATE TABLE
The SQL CREATE TABLE Statement
 The CREATE TABLE statement is used to
create a new table in a database.
 Syntax
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
SQL ALTER TABLE Statement
 The ALTER TABLE statement is used to add,
delete, or modify columns in an existing
table.
 ADD COLUMN
 Syntax
 ALTER TABLE table_name
ADD column_name datatype;
 DROP COLUMN
 The syntax to drop a column in an existing
table in SQL.
 SYNTAX
ALTER TABLE table_name
DROP COLUMN column_name;
 RENAME COLUMN
 The syntax to rename a column in an existing
table in SQL.
 SYNTAX
ALTER TABLE table_name
RENAME COLUMN column_name to new-name;
 MODIFY COLUMN
 You can use the ALTER TABLE statement in
SQL Server to modify a column in a table.
 BEFORE MODIFYING CHECK THAT YOUR
COLUMN IS EMPTY.
 SYNTAX
ALTER TABLE table_name
MODIFY column_name datatype;
The SQL RENAME Statement
The RENAME statement is used to Rename TABLE
in a database.
 Syntax
RENAME table_name
TO NEW TABLE_NAME ;
 The SQL DROP TABLE Statement
 The DROP TABLE statement is used to drop
an existing table in a database.
 Syntax
 DROP TABLE table_name;
 SQL TRUNCATE TABLE
 The TRUNCATE TABLE statement is used to
Remove all rows from table but not table.
 Syntax
 TRUNCATE TABLE table_name;

DDL DATA DEFINATION LANGUAGE

  • 1.
    DDL(Data definition language): (Oprationson table) A data definition language is a syntax for defining data structures, especially database. Common DDL statements are CREATE, ALTER, RANAME,DROP AND TRUNCATE.
  • 2.
    • Must beginwith a letter • Can be 1-30 characters long • Must contain only A-Z,a-z,0-9,_,$,and # • Must not duplicate the name of another object owned by the same user • Must not be an oracle serve reserved word
  • 3.
    1:CREATE TABLE 2:ALTER TABLE 3:RENAMETABLE 4:DROP TABLE 5:TRUNCATE TABLE
  • 4.
    The SQL CREATETABLE Statement  The CREATE TABLE statement is used to create a new table in a database.  Syntax CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype, .... );
  • 5.
    SQL ALTER TABLEStatement  The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.  ADD COLUMN  Syntax  ALTER TABLE table_name ADD column_name datatype;
  • 6.
     DROP COLUMN The syntax to drop a column in an existing table in SQL.  SYNTAX ALTER TABLE table_name DROP COLUMN column_name;
  • 7.
     RENAME COLUMN The syntax to rename a column in an existing table in SQL.  SYNTAX ALTER TABLE table_name RENAME COLUMN column_name to new-name;
  • 8.
     MODIFY COLUMN You can use the ALTER TABLE statement in SQL Server to modify a column in a table.  BEFORE MODIFYING CHECK THAT YOUR COLUMN IS EMPTY.  SYNTAX ALTER TABLE table_name MODIFY column_name datatype;
  • 9.
    The SQL RENAMEStatement The RENAME statement is used to Rename TABLE in a database.  Syntax RENAME table_name TO NEW TABLE_NAME ;
  • 10.
     The SQLDROP TABLE Statement  The DROP TABLE statement is used to drop an existing table in a database.  Syntax  DROP TABLE table_name;
  • 11.
     SQL TRUNCATETABLE  The TRUNCATE TABLE statement is used to Remove all rows from table but not table.  Syntax  TRUNCATE TABLE table_name;