3. Introduction
Structured Query Language (SQL) is the standard language for accessing information a
database.
SQL is case-insensitive and free format.
Enter commands interactively or in a script file.
SQL statements can use multiple lines
end each statement with a semi-colon ;.
4. A Brief History of SQL
● 1970 − Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational
databases. He described a relational model for databases.
● 1974 − Structured Query Language appeared.
● 1978 − IBM worked to develop Codd's ideas and released a product named
System/R.
● 1986 − IBM developed the first prototype of relational database and standardized by
ANSI. The first relational database was released by Relational Software which later
came to be known as Oracle
5. Database
Structured collection of data.
Tables
Fields
Query
Reports
Essentially a much more sophisticated implementation of the flat files.
6. Database Management System
Manages the storage and retrieval of data to and from the database and hides the
complexity of what is actually going on from the user.
MySQL is a relational database management system
7. Relational Database
Stores data in separate tables instead of a single store.
Relationships between tables are set
In theory, this provides a faster, more flexible database system.
8. Basic Database Server Concepts
Database runs as a server
Attaches to either a default port or an administrator specified port
Clients connect to database
For secure systems
authenticated connections
usernames and passwords
Clients make queries on the database
Retrieve content
9. SQL Commands
DDL - Data Definition Language
Command & Description
CREATE
Creates a new table, a view of a table, or other object in the database.
ALTER
Modifies an existing database object, such as a table.
DROP
Deletes an entire table, a view of a table or other objects in the database.
10. Continue...
DML - Data Manipulation Language Command & Description
1.SELECT
Retrieves certain records from one or more tables.
2.INSERT
Creates a record.
3.UPDATE
Modifies records.
4.DELETE
Deletes records.
11. Continue...
DCL - Data Control Language
Command & Description
GRANT
Gives a privilege to user.
REVOKE
Takes back privileges granted from user.