SQL Overview Structured Query Language. Description When Codd first described the theory of...

8
SQL Overview Structured Query Language

Transcript of SQL Overview Structured Query Language. Description When Codd first described the theory of...

Page 1: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

SQL Overview

Structured Query Language

Page 2: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Description

When Codd first described the theory of relational databases, he asserted that there should be a comprehensive language that would describe both the data and the meta data.

SQL has developed into that language

Page 3: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

SQL Features

SQL does not come as a separate package

It is always a part of a Data Base Management system

SQL is a fourth generation language (meaning it is not procedural. You describe what you want to do not how to do it)

Page 4: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Standards

SQL is an ANSI standard Most DBMS implement the 1992

standard, some are beginning to implement the 1999 standard

In addition to the standard SQL most DBMSs add their own commands and features SQL Server has T-SQL Oracle has PSQL

Page 5: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Three Uses

To define data (including setting indexes and user permissions)

To query data To manipulate data

Page 6: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Data Definition

You can define all the data structures in a relational database with SQLCREATE TABLE tblCustomer ( CustomerID Integer Primary Key, CustomerLastName varchar(50), CustomerFirstName varchar(35) )

Page 7: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Data Query

You can retrieve any data or combination of the data from the database with SQL queriesSELECT CustomerLastName,

CustomerFirstname, OrderID, OrderDate

FROM tblCustomer cINNER JOIN tblOrder oON c.CustomerID=o.CustomerIDWHERE c.CustomerID=5;

Page 8: SQL Overview Structured Query Language. Description  When Codd first described the theory of relational databases, he asserted that there should be a.

Data Manipulation

You can Insert, Update and Manipulate data with SQL

UPDATE tblCustomerSET LastName=‘Smith’WHERE CustomerID=7;