11
Structured Query Language sql

Sql - Structured Query Language

Embed Size (px)

DESCRIPTION

Structured Query Language

Citation preview

Page 1: Sql - Structured Query Language

Structured Query Language

sql

Page 2: Sql - Structured Query Language

SQLWhat is

History

Statement

DDL

DML

Outline

Page 3: Sql - Structured Query Language

SQLStructured Query Language

Special-purpose programming language for working with sets of facts and the relationships between them.

DML

DDL

SQL

Page 4: Sql - Structured Query Language

SEQUEL

Donald D. Chamberlin

and Raymond F. Boyce

1970s

IBM

SQLHistoryDevelop by

(Structured English Query Language)

Initial version

Page 5: Sql - Structured Query Language

DDLData Definition Language

CREATE

ALTER

an object (a table) in the database

modifies the structure of an existing object

TRUNCATEdeletes all data from a table

DROPdelete an object

Page 6: Sql - Structured Query Language

DMLData Manipulation Language

Adds rows to an existing table

Modifies a set of existing table rows

Removes existing rows from a table

INSERT

UPDATE

DELETE

Page 7: Sql - Structured Query Language

INSERT

Page 8: Sql - Structured Query Language

UPDATE

Page 9: Sql - Structured Query Language

DELETE

Page 10: Sql - Structured Query Language

?SelectStatement

Data Retrieval

Criteria

DataTables

What tables contain the data

How data from different sources is related

Which fields or calculations will produce the data

Criteria that data must match to be included

Whether and how to sort the results

Page 11: Sql - Structured Query Language

SelectStatement

SELECT <field> FROM <table> WHERE <criterion>;

Basic

SELECT name, addressFROM studentWHERE stuID=123;

Example