Professional Documents
Culture Documents
-DDL commands are used to define, modify, and manage the structure of database objects, such as tables, indexes, and
constraints. Some common DDL commands include:
tblNewEmployees
dbTestDatabase
1.1 CREATE TABLE SQL CODE:
CREATE DATABASE dbTestDatabase;
1.2 CREATE TABLE SQL CODE:
CREATE TABLE tblNewEmployees
(
EmployeeID INT NOT NULL,
FirstName VARCHAR(5),
LastName VARCHAR(20),
Age int,
Address VARCHAR(30)
);
++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++
CREATE TABLE tblNewEmployees
(
EmployeeID INT NOT NULL PRIMARY KEY,
FirstName VARCHAR(5),
LastName VARCHAR(20),
Age int,
Address VARCHAR(30)
);
++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++
(if PK is Auto_Increment)
ALTER TABLE tblNewEmployees
MODIFY EmployeeID INT NOT NULL;
++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++
Done!