What is SQL?
SQL is Structured Query Language, which is a computer language for storing, manipulating
and retrieving data stored in relational database.
SQL is the standard language for Relation Database System. All relational database
management systems like MySQL, MS Access, Oracle, Sybase, Informix and SQL Server use
SQL as standard database language.
SQL (Structured Query Language) is a language used to access data from the database. The
SQL is used for doing various database operations like creating database objects,
manipulating data in the database and controlling access to the data.
Why SQL?
Allows users to access data in relational database management systems.
Allows users to define the data in 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.
Note: CEO of Oracle Corporation is “Larry Ellison”
History of Oracle: (Different versions of Oracle)
In 1977, SEL (Software Development Laboratory) … V1
In 1979, RSI (Relational S/W Incorporation) …. V2
In 1983, Oracle Corporation Oracle 3 *Developed Using ‘C’, which supports simple
queries but does not support transactions]
In 1984, Oracle 4 Supports Transactions [Commit/Rollback]
In 1985, Oracle 5 Client-Server Architecture *Only install DB in Server, so that ‘N’
no of Clients can connect is known as Client-Server Architecture].
In 1989, Oracle 6 PL/SQL
In 1992, Oracle 7 Supports DWH [OLAP-Online Analytical Processing]
In 1997, Oracle 8 ORDMBS
In 1999, Oracle 8i ‘I’ means Internet & it has inbuilt JVM (JAVA Virtual Machine)
In 2001, Oracle 9i with 400 New features, e.g. XML (Xtended Markup Language),
RAC (Real Application Clusters) etc which provided high availability & performance.
In 2003, Oracle 10g ‘g’ means grid (group of DB Servers)
In 2006, Oracle 11g we can add columns with values etc.
11.2.0.1.0
Major Version Minor Version or 2nd Release Application Release Patch Release Set
Platform specific
Some of the Most Important SQL Commands:
SELECT - Extracts data from a database
UPDATE - Updates data in a database
DELETE - Deletes data from a database
INSERT INTO - Inserts new data into a database
CREATE TABLE - Creates a new table
ALTER TABLE - Modifies a table
DROP TABLE - Deletes a table
CREATE INDEX - Creates an index (search key)
DROP INDEX - Deletes an index
SQL Commands:
The standard SQL commands to interact with relational databases are CREATE, SELECT,
INSERT, UPDATE, DELETE and DROP. These commands can be classified into groups based
on their nature:
DDL - Data Definition Language:
Command Description
CREATE Creates a new table, a view of a table, or other object in database
ALTER Modifies an existing database object, such as a table.
DROP Deletes an entire table, a view of a table or other object in the database.
DML - Data Manipulation Language:
Command Description
INSERT Creates a record
UPDATE Modifies records
DELETE Deletes records
DCL - Data Control Language:
Command Description
GRANT Gives a privilege to user
REVOKE Takes back privileges granted from user
DQL - Data Query Language:
Command Description
SELECT Retrieves certain records from one or more tables
What is Database?
1) It is a collection of Inter-Related data. Records the data in HDD (Permanent
Memory).
2) Inter-Related data means relation among data values
3) Objective of DB is to record data & save it for future use.
What is RDBMS?
RDBMS stands for Relational DataBase Management System. RDBMS is the basis for SQL,
and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and
Microsoft Access.
A Relational database management system (RDBMS) is a database management system
(DBMS) that is based on the relational model as introduced by E. F. Codd.
ODBC: (Open DB Connectivity)
1) It is open to all S/W & standardized by ANSI (American National Standard Institute).
2) It acts as an Interface between two different S/W.
3) Main job of ODBC drivers is Data Transformation & Data Transportation.
Data Transformation: It converts one S/W Data Types into another S/W corresponding Data
Types.
Data Transportation: It carries instructions from front end (S/W application) & transfers to
back end (DB) and vice-versa.
Note: Database is a Client-Server Architecture.
(Nos, Varchar2, Decimal etc) Data Transformation (Int, String, Float etc)
Dev’d form
Data Transportation ANSI SQL Data Transportation
Login
Oracle Pwd
DB ODBC Drivers
OK Cance
Back end (Server) Client (Front end)
SELECT, INSERT,
UPDATE, DELETE