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
syntax: create table
table_name<field1><datatype>,<field2><datatype>,………..<fieldn><datatype>;
Alter:
Syntax: alter table table_name add
column_name datatype;
Drop command delete all the record with
structure
Syntax: drop table table_name;
syntax: rename table_name to new_name;
Syntax:Truncate table table_name;
Truncate:
Truncate command is used to remove only
table records.
Truncate table table_name;
Drop command is used to remove both
table and table records permanently
Syntax:
Drop table table_name;
No comments:
Post a Comment