SQL
OVERVIEW
INTRODUCTION:
•Structured
Query Language
•RDBMS
is the basis for SQL
•SQL
is a standard language for accessing databases
for access and manipulating data
•ANSI
(American National Standards Institute) standard
•SQL
is not case sensitive
TABLES:
•Data in RDBMS is
stored in database objects called tables
•Database most often
contains one or more tables
•Identified
by a name
•e.g.
"Customers" or "Orders"
•Collection
of related data entries
•Consists of columns
and rows
SQL can be divided into two parts
vData
Manipulation Language (DML)
vData
Definition Language (DDL)
Data
Manipulation Language (DML)
•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
Data Definition
Language (DDL)
•CREATE DATABASE - creates a new database
•ALTER DATABASE - modifies a database
•CREATE TABLE - creates a new table
•ALTER TABLE - modifies a table
•DROP TABLE - deletes a table
VIEWS
•Virtual
table
•Based on the
result-set of an SQL statement
•Contains rows and
column
•Create, Update, and
Delete a view
•Fields in a view are
fields from one or more real tables in the database
•Summarize
data from various tables which can be used to generate reports
