0% found this document useful (0 votes)
6 views19 pages

Lecture 6

database

Uploaded by

turnekanji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views19 pages

Lecture 6

database

Uploaded by

turnekanji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

SQL (Structured Query Language)

Background

• SQL, Structured Query Language, is a programming language


designed to manage data stored in relational databases. SQL operates
through simple, declarative statements. This keeps data accurate and
secure, and it helps maintain the integrity of databases, regardless of
size.

• SQL is a database computer language designed for the retrieval and


management of data in a relational database.
Why to Learn SQL?

• 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 access data in the relational database management systems.

• Allows users to describe the data.

• Allows users to define the data in a database and manipulate that data.

• Allows users to create and drop databases and tables.

• Allows users to create view, stored procedure, functions in a database.

• Allows users to set permissions on tables, procedures and views.


Types of SQL Commands
1. Data Definition Language (DDL)
• DDL changes the structure of the table like creating a table, deleting a table, altering a table, etc.

• 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

• The USE statement is used to select the database on


which you want to perform operations.
INSERT
• This statement is used to insert new records into the
table.
Syntax
EXAMPLE`

INSERT INTO Employee_Info(EmployeeID, EmployeeName, Emergency ContactName, PhoneNumber, Address, City, Country)
VALUES ('06', 'Sanjana','Jagannath', '9921321141', 'Camel Street House No 12', 'Chennai', 'India');

INSERT INTO Employee_Info


VALUES ('07', 'Sayantini','Praveen', '9934567654', 'Nice Road 21', 'Pune', 'India');
UPDATE & DELETE
SELECT
END

You might also like