PowerPoint - averia.unm.edu - University of New Mexico

mewstennisΛογισμικό & κατασκευή λογ/κού

4 Νοε 2013 (πριν από 3 χρόνια και 5 μήνες)

99 εμφανίσεις

THE ROBERT O. ANDERSON

SCHOOL AND GRADUATE SCHOOL

OF MANAGEMENT

The University of New Mexico

MGT 329/637

Spring 2009


Structured Query Language (SQL)

Introduction

Last Revised:
11/5/2013 12:41 AM

SQL History & Standards


Structured Query Language (SQL)

was
developed by IBM in the 1970s (originally called
SEQUEL)


After many modifications, it became an ANSI
standard


the most current version is SQL3, the
previous version is SQL92


SQL92 is supported by all major RDBMSs.


Many vendors have developed proprietary extensions
and modifications that are not portable across DBMSs


Most client
-
server and 3
-
tier software uses SQL to
interact with the database

SQL Capabilities


SQL is not a complete programming language


it
is a language to express database manipulation
commands


SQL has no programming language constructs like
variables, control structures, functions, etc.


SQL is usually embedded within another
programming/scripting language or generated by an
IDE or query tool


SQL is the language used to communicate between two
of the three layers in 3
-
tier architecture

3
-
Tier Architecture


3
-
tier architecture decomposes an application into
three distinct software pieces:


Data Layer


View Layer


Business Logic Layer

3
-
Tier Architecture


Data Layer


Data Layer:


The data layer is a repository for and manager of
program or system
data


The data layer is usually implemented with one or more
relational DBMSs
and a set or utilities, programs, or
classes that interact with the
DBMS


The business layer sends SQL commands to the
data layer and receives responses as:


Result/status codes


for example, to indicate that a
new row was successfully added


Output data


for example, a table containing a row
from the employee table matching a specific primary
key value

3
-
Tier Architecture
With
A Web Browser, Web
Server, and Scripting Language(s)

© ISBN 0
-
13
-
084887
-
5, p.280

3 Tier Architecture Implemented As An Object
-
Oriented Program

SQL Concepts and Statement Types


Catalog



A set of schemas that constitute the description of a database


Schema


The structure that contains descriptions of objects created by a
user (base tables, views, constraints)


Data Definition Language (DDL)


Commands that define database structure, including creating,
altering, and dropping tables and establishing constraints


Data Manipulation Language (DML)


Commands that query database contents and add, modify, or
delete data within tables


Data Control Language (DCL)


Commands that administratively control a database, including
user privileges and transaction processing

SQL Statement Types

Hoffer 8e, Figure 7
-
4 © 2007 Prentice
-
Hall