--> Sayadasite: DDL

Multiple Ads

Search

Menu Bar

DDL

SQL(structure query language)

Every relational database software interact with a language known as SQL because it’s a simple English like language which guidelines are provided by a standard organization ‘ANSI’ adopted by all database vendors like oracle, mysqlm,Microsoft etc.

     An SQL is very complex language to reduce its complexity, it can sub categorized into 5 sub languages.

DDL(data definition language)

Create

Alter

Drop

Rename

Truncate

DML(data manipulation language)

Insert

Update

Delete

DQL(data query language)

select

DCL(data control language)

Grant

Revoke

TCL(transaction control language)

Commit

Rollback

savepoint

 DDL(data definition language)

Create

Alter

Drop

Rename

Truncate

 create:

syntax: create table table_name<field1><datatype>,<field2><datatype>,………..<fieldn><datatype>;

Alter:

Syntax: alter table table_name add column_name datatype;

 Drop:

Drop command delete all the record with structure

Syntax: drop table table_name;

 rename:

syntax: rename table_name to new_name;

 Truncate command Delete all the record not the structure

Syntax:Truncate table table_name;

 Difference between truncate and drop:

Truncate:

Truncate command is used to remove only table records.

 Syntax:

Truncate table table_name;

 Drop:

Drop command is used to remove both table and table records permanently

Syntax:

Drop table table_name;

 

No comments: