Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tutorial 6 SQL Muhammad Sulayman

Similar presentations


Presentation on theme: "Tutorial 6 SQL Muhammad Sulayman"— Presentation transcript:

1 Tutorial 6 SQL Muhammad Sulayman msul028@ec.auckland.ac.nz

2 SQL - Background SQL, stands for Structured Query Language, is the most influential commercially marketed query language. IBM developed the original version of SQL at its San Jose Research Laboratory and implement it (called as Sequel) as part of the System R project in the early 1970s. Now SQL is the standard relational- database language. The SQL standard is controlled by American National Standards Institute (ANSI) and the International Organization for Standardization (ISO).

3 SQL - Introduction The SQL language has several parts (3): DDL, Data-definition language, is used to define relation schemas, deleting relations, and modifying relation schemas; DML, Interactive data-manipulation language, includes commands to query tuples from, Insert tuples into, delete tuples from and modify tuples in the database; And other things, such as view definition, transaction control and etc. DCL (data control language)

4 SQL – Basic commands Note: simple but informal syntax! Create a table: CREATE TABLE (Attribute_Definitions) Delete a table: DROP TABLE Query: SELECT [DISTINCT] Select_Expression,... FROM Table_References [WHERE Where_Definition]

5 SQL – Basic commands Insert: INSERT INTO [(ColmnList)] VALUES(DataList) Delete: DELETE FROM [WHERE Where_Definition] Update: UPDATE SET Column_Name1=Expression1, [Column_Name2=Expression2,...] [WHERE Where_Definition]

6 SQL - Resources Reference - Introduction to Structured Query Language: http://www.cs.auckland.ac.nz/references/sql/ sqlTutorial.pdf

7 Exercise Time!


Download ppt "Tutorial 6 SQL Muhammad Sulayman"

Similar presentations


Ads by Google