Lecture 6
Lecture 6
Background
• SQL is Structured Query Language, which is a computer language for storing, manipulating and
retrieving data stored in a relational database.
• SQL is the standard language for Relational Database System. All the Relational Database
Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and
SQL Server use SQL as their standard database language.
Applications of SQL
• Allows users to define the data in a database and manipulate that data.
• All the command of DDL are auto-committed that means it permanently save all the changes in the
database.
2. DML - Data Manipulation Language
• DML commands are used to modify the database. It is responsible for all form of changes in the database.
• The command of DML is not auto-committed that means it can't permanently save all the changes in the
database. They can be rollback.
3. DCL - Data Control Language
• DCL commands are used to grant and take back authority from any database user.
Basic SQL Commands
CREATE
CREATE DATABASE
Syntax:
CREATE DATABASE <database name>;
CREATE TABLE:
Syntax:
EXAMPLE
ALTER
ALTER TABLE
Syntax :
EXAMPLE
USE
INSERT INTO Employee_Info(EmployeeID, EmployeeName, Emergency ContactName, PhoneNumber, Address, City, Country)
VALUES ('06', 'Sanjana','Jagannath', '9921321141', 'Camel Street House No 12', 'Chennai', 'India');