You are on page 1of 1

Data Definition Language – create & modify the structure of db objects in the db by creating, altering, and dropping tables

and views

Data Manipulation Language – performs db maintenance, such as inserting, updating, modifying, and querying data in the db

Data Control Language – to protect the db from corruption & security by controlling rights & permissions to grant or revoke privileges for
accessing the db

Examples:

- :

CREATE DATABASE YourDatabaseName

USE YourDatabaseName

CREATE TABLE Employees (

EmployeeID INT PRIMARY KEY,


FirstName VARCHAR(50),
LastName VARCHAR(50),
HireDate DATE
)
- :
USE product_profile
- :
ALTER TABLE student_profile
ADD username NVARCHAR(50),
ADD profile NVARCHAR(50);

Or: ALTER COLUMN student_id int NOT NULL;


Or: DROP COLUMN student_id; / DROP TABLE student_profile;
Or: MODIFY COLUMN FirstName NVARCHAR(50);

- (PRETEND THIS IS A TABLE:

StudentID | StudentName | StudentSection

001 | Jared | Diamond)

UPDATE YourTableName
SET StudentSection = 'Pearl'
WHERE StudentID = '001';

You might also like