PRIYANKA
, SQL COMMANDS
SQL(Structure Query Language) commands are instructions. It is used to communicate
database. It is used to perform specific tasks, functions and queries of data.
There are several categories of SQL commands are as follows:-
1) Data Definition Language (DDL)
2) Data Manipulation Language (DML)
3) Data Control Language (DCL)
4) Transaction Control Language (TCL)
5) Data Retrieval Language (DRL)
, 1) DATA DEFINITION LANGUAGE (DDL)
DDL
Data Definition Language, which defines
the structure or schema of the database. C 1. CREATE
DDL commands are SQL commands used O
2. ALTER M
to modify or alter the structure of the
M 3. RENAME
database. A
DDL commands are used to perform the 4. TRUNCATE N
D
following operation on table :- 5. DROP
S
, 1) DATA DEFINITION LANGUAGE (DDL)
1. CREATE
To create a table in a database. EXAMPLE :
Syntax:- SQL> create table Products
create table <tablename> (productid number(5),
( column1 datatype(size), productName varchar2(20));
column2 datatype(size),
………………………., output:-
column n datatype(size)); Table created.