CBSE BOARD X, asked by samrat1234, 1 year ago

what is DDL. mention any two DDL statements

Answers

Answered by shauryamanjaisdij
3
SQL‎ > ‎
DDL Commands - Create - Drop - Alter - Rename - Truncate


DDL Commands

DML Commands

DCL Commands

TCL Commands

Data Constraints
The Create Table Command

The create table command defines each column of the table uniquely. Each column has minimum of three attributes.
Name
Data type
Size(column width).
Each table column definition is a single clause in the create table syntax. Each table column definition is separated from the other by a comma. Finally, the SQL statement is terminated with a semicolon.

The Structure of Create Table Command

Table name is Student
Column name
Data type
Size
Reg_no varchar2 10
Name char 30
DOB date
Address varchar2 50

Example:

CREATE TABLE Student
(Reg_no varchar2(10),
Name char(30),
DOB date,
Address varchar2(50));


The DROP Command

Syntax:
DROP TABLE <table_name>

Example:
DROP TABLE Student;
It will destroy the table and all data which will be recorded in it.


The TRUNCATE Command

Syntax:
TRUNCATE TABLE <Table_name>

Example:
TRUNCATE TABLE Student;


The RENAME Command

Syntax:
RENAME <OldTableName> TO <NewTableName>

Example:
RENAME <Student> TO <Stu>

The old name table was Student now new name is the Stu.

Answered by SassyBae
7
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.

The DROP command and the RENAME command

HOPE IT HELPS PLEASE MARK AS THE BRAINLIEST ;-)
Similar questions