Sie sind auf Seite 1von 7

Introduction to SQL

The name SQL pronounced as ‘ess-cue-ell’ or ‘sequel’ is the abbreviation for Structured Query
Language. The SQL consists of a set of facilities for defining, accessing and managing relational
databases. In order to understand why SQL has become so popular and important, it is helpful to
have an idea of the major developments in database technology over the past 20 to 30 years.

1. In 1970 E.F. Codd, member of IBM lab in San Jose, California, published the classic paper,
A Relational Model of Data for Large Shared Data Banks, in which he laid down a set of
abstract principles of Database Management, the so called relational model. The entire
field of relational database management system has its origins in that paper.
2. Codd’s paper triggered of a great deal of research and experimentation and led to the
design and prototype implementation of a variety of relational languages. A relational
language is a language that realizes, in some concrete syntactic form, some or all of the
features of the abstract relational mode. Several such languages were created in the early
and mid 70s. One such language was Structured English Query Language (SEQUEL),
defined by Donald Chamberlin and others at the IBM San Jose Lab in 1974, and was
implemented in the IBM prototype called SEQUEL-XRM in 1974-75.
3. As a result of the experience with SEQUEL-XRM, a revised and refined version of SEQUEL
was released in 1976-77 called SEQUEL/2. This name was later changed to SQL. Based
on SEQUEL/2 or SQL another prototype was developed by IBM called System R. System R,
an implementation of a large subset of the SQL, became operational in1977 and was
installed in a number of user sites. Based on user feedback, the System R and the SQL
underwent a lot of changes.
4. Getting inspiration from the success of system R, software companies other than IBM also
began developing products that implemented SQL, and the first product that came out
was ORACLE from Relational Software Inc. In 1981, IBM announced its SQL product,
SQL/DS. In 1883 IBM announced another product called DB2.
5. Over the next several years, numerous other vendors announced their products. Some of
them are DG/SQL from Data General Corporation (1984), SYBASE from Sybase Inc.(1986).
In addition to this SQL interfaces were developed for existing product such as INGRRESS.
Now there are more than 100 products that support some dialect of SQL running on
machines ranging from small PCs to the largest mainframes. SQL has become the
standard in the Relational Database world.
6. In 1982 the American National Standards institute (ANSI) charted its database committee
to develop a proposal for a standard relational language. The proposal of the committee
was ratified by ANSI in 1986 and was accepted as the international standard in 1987 by
the International Organization for Standardization (ISO). From then onwards the SQL
standard has undergone various transformation and modifications over the years, and now
the latest version is known as SQL2 or SQL/92 which was introduced in 1992.

Characteristics of SQL
1. SQL is a high level language that provides a greater degree of abstraction than procedural
languages. It is fashioned so that the programmer can specify what data is needed but
need not specify how to retrieve it.
2. SQL enables the end-users and systems personnel to deal with a number of database
management systems where it is available. Increased acceptance and availability of SQL
are also in its favour.
3. Applications written in SQL can be easily ported across systems. Such porting could be
required when the underlying Database Management System needs to be upgraded or
changed.
4. The language even while being simple and easy to learn, can handle complex situations.

1
5. All SQL operations are performed at a set level. One select statement can retrieve multiple
rows, one modify statement can modify multiple rows.

Codd’s Rules
1. Information Rule: All information in a relational database including table names, column
names are represented by values in tables. The simple view of data speeds design and
learning. User productivity is improved since knowledge of only one language is necessary
to access all data such as description of the table and attributes definitions, integrity
constraints. Action can be taken when the constraints are violated. Access to data can be
restricted. All these information are also stored in tables.

2. Guaranteed Access Rule. Every piece of data in a relational database can be accessed
by using a combination of table name, a primary key value and identifies the row and a
column name which identified a cell. User productivity is improved since there is no need
to resort to using physical pointers or address. It also provides data independence and
makes it possible to retrieve each individual piece of data stored in a relational database
by specifying the name of the table in which it is stored, the column and the primary key
which identifies the cell in which it is stored.

3. Systematic Treatment of Nulls Rule: The RDBMS handles records that have unknown
or inapplicable values in a pre-defined fashion. Also, the RDBMS distinguishes between
zeros, blanks and nulls in the records and handles such values in a consistent manner that
produces correct answers, comparisons and calculations. Through the set of rules for
handling nulls, users can distinguish results of the queries that involve nulls, zeros and
blanks. Even through the rule doesn’t specify what should be done in the case of nulls, it
specifies that there should be a consistent policy in the treatment of nulls.

4. Active on-line catalog based on the relational model: The description of a database
and its contents are database tables and therefore can be queried on-line via the data
manipulation language. The Database Administrator’s productivity is improved since the
changes and additions to the catalog can be done with the same commands that are used
to access any other table. All queried and reports can also be done as any other table.

5. Comprehensive data sub-language rule: The RDBMS may support several languages.
But at least one of then should allow the user to do all of the following: define tables and
views, query and update data, set integrity constraints, set authorizations and define
transactions. User productivity is improved since there is just one approach that can be
used for all database operations. In amulti-user environment the user does not have to
worry about the data integrity and such things, which will be taken care by the system.
Also only users with proper authorization will be able to access data.

6. View Updating Rule: Any view that is theoretically updatable can be updated using the
RDBMS. Data consistency is ensured since the change made in the view is transmitted to
the base-table and vice-versa.

7. High-Level Insert, Update and Delete: The RDBMS supports insertion, updation and
deletion at a table level. The performance is improved since the commands act on a set of
records rather that one record at a time.

8. Physical Data Independence: The execution of ad hoc requests and application


programs is not affected by changes in the physical data access and storage methods.
Database administrators can make changes to the physical access and storage method
2
which improve performance and do not require changes in the application programs or
requests. Here the user specifies what he wants and need not worry about how the data is
obtained.

9. Logical Data Independence: Logical changes in tables and views such as


adding/deleting columns or changing field lengths need not necessitate modifications in
the programs or in the format of ad hoc requests. The database can change and grow to
reflect changes in reality without requiring the user intervention or changes in the
applications. For example adding an attribute or column to the base table should not
disrupt the programs or the interactive commands that have no use for the new attribute.

10. Integrity Independence: Like table and view definitions, integrity constraints are stored
in the on-line catalog and can therefore be changed without necessitating changes in the
application programs. Integrity constraints specific to a particular Relational Database
must be definable in the relational data sub-language and storable in the catalog. At least
the Entity integrity and referential integrity must be supported.

11. Distribution Independence: Application programs and ad hoc requests are not affected
by changes in the distribution of physical data. This improves systems reliability since
application programs will work even if the programs and data are moved in different sites.

12. Non-subversion Rule: If the RDBMS has a language that accesses the information of a
record at a time, this language should not be used to bypass the integrity constraints. This
is necessary for data integrity.

According to Dr. Codd, a Relational Database Management System (RDBMS) must be able
to manage the database entirely through its relational capabilities.

>>Normalization (Normal Form)


First Normal Form (1NF): Information must be collected in the form the records i.e. no
combination or grouping of data.

Second Normal Form (2NF): Relations in second normal form (2NF) must satisfy the
additional constraint that all non-key attributes must be functionally dependent on the
whole of each relation key. Relations in 2NF can not have non-key attributes that depend
on only part of a relation key. i.e. Remove the offending functional dependency.

Third Normal Form (3NF): Relations in 2NF can still contain redundancies, and
additional constraints must be satisfied to eliminate such redundancies. Relations in third
normal form (3NF) must satisfy yet another constraint. In such relations, there must be no
dependencies between non-key attributes.
a) Relations not in third normal form
Reg-No Owner Model Manufacturer No-
(Relation Cylinders
Key)
YX-01 George Laser Ford 4
YJ-77 Mary Falcon Ford 6
YW-30 George Corolla Toyota 4
YJ-37 Mary Laser Ford 4
YJ-83 Andrew Corolla Toyota 4

3
b)Relations in third normal key
(Registration)
Reg-No Owner Model Manufacture
(Relation Key) r
YX-01 George Laser Ford
YJ-77 Mary Falcon Ford
YW-30 George Corolla Toyota
YJ-37 Mary Laser Ford
YJ-83 Andrew Corolla Toyota

(Vehicle)
Model Manufacturer No-
Cylinders
(Relation Key)
Laser Ford 4
Falcon Ford 6
Corolla Toyota 4
Laser Ford 4
Corolla Toyota 4
Optimal Normal Form

What is needed is a higher normal form-one that takes overlapping keys into
account. Such a higher normal form is the Boyce-Codd normal form(BCNF). A relation R
is in BCNF if for every functional dependency (X→Y) between any relation attributes,
the attributes on the left-hand side (that is, X) are a relation key.
A set of relations that have no single-valued redundancy.

(a) A non-normal form relation with overlapping keys

Relation key 2

Relation Key1

Project-ID Person- Manager Time-


ID Spent
Proj1 J1 Vicki 30
Proj2 J1 Joe 12
Proj1 J2 Vicki 11
Proj2 J2 Joe 79
Proj3 J2 Belinda 17
Proj2 J3 Joe 3

Projects

Project-ID Manager
(Relation Key)
Proj1 Vicki
Proj2 Joe
4
Proj1 Vicki
Proj2 Joe
Proj3 Belinda
Proj2 Joe
Work
Project-ID Person- Time-
ID Spent
Proj1 J1 30
Proj2 J1 12
Proj1 J2 11
Proj2 J2 79
Proj3 J2 17
Proj2 J3 3

About Oracle Corporation

Oracle Corporation was founded in 1977 in Redwood, California. They introduced the first
Relational Database Management System based on the IBM System/R model and the first
database management system utilizing IBM's Structured Query Language (SQL) technology.

Today, the Oracle DBMS is supported on over 80 different operating environments, ranging from
IBM mainframes, DEC VAX minicomputers, UNIX-based minicomputers, Windows NT and several
proprietary hardware-operating system platforms, and is clearly the world's largest RDBMS
vendor.

Oracle employs more than 42,000 professionals in 93 countries around the world. Their
expenditure for research and development is approximately 13% of their revenues.

Lawrence J. Ellison (Born: 1944, Chicago) is president and CEO of Oracle corporation.

He's the Oracle worlds hero, and he should be. Oracle Corporation, the company he founded
with Robert N. (Bob) Miner and Ed Oates back in 1977, has emerged as the world's largest
vendor of software that helps large corporations and governments better manage their
information.

The word Oracle means:


Prophecy or prediction; answer to a question believed to come from the gods; a statement
believed to be infallible and authoritative; a shrine at which these answers are given

There is, however, more to the word Oracle: used for the name of the database engine, and then
later for the company itself. Larry Ellison and Bob Miner were working on a consulting project for
the CIA (Central Intelligence Agency in USA) where the CIA wanted to use this new SQL language
that IBM had written a white paper about. The code name for the project was Oracle (the CIA
saw this as the system to give all answers to all questions or something such ;-).

The project eventually died (of sorts) but Larry and Bob saw the opportunity to take what they
had started and market it. So they used that project's codename of Oracle to name their new
RDBMS engine. Funny thing is, that one of Oracle's first customers was the CIA...

Oracle's main competitors in the database business are:

CA with Ingres
IBM with DB/2
5
Informix with the Informix DB
Microsoft with Access and SQL Server
Software AG with ADABAS
Sybase with their Sybase System
PostgreSQL (free open source database)
Oracle's main competitors in the applications business are:
SAP (R/2 and R/3)
Baan

Oracle's History

1977
Relational Software Inc. (RSI - currently Oracle Corporation) established
1978
Oracle V1 ran on PDP-11 under RSX, 128 KB max memory. Written in assembly language.
Implementation separated Oracle code and user code. Oracle V1 was never officially
released.
1980
Oracle V2 released on DEC PDP-11 machine. Still written in PDP-11 assembly language,
but now ran under Vax/VMS.
1982
Oracle V3 released, Oracle became the first DBMS to run on mainframes, minicomputers,
and PC's. First release to employ transactional processing. Oracle V3's server code was
written in C.
1983
Relational Software Inc. changed its name to Oracle Corporation.
1984
Oracle V4 released, introduced read consistency, was ported to multiple platforms, first
interoperability between PC and server.
1986
Oracle V5 released. Featured true client/server, VAX-cluster support, and distributed
queries. (first DBMS with distributed capabilities).
1988
Oracle V6 released.
1989
Released Oracle 6.2 with Symmetric cluster access using the Oracle Parallel Server
1991
Reached power of 1,000 TPS on a parallel computing machine. First database to run on a
massively parallel computer.
1992
Released Oracle7 for Unix
1993
Rollout of Oracle's Cooperative Development Environment (CDE). Introduction of Oracle
Industries and the Oracle Media Server.
1994
Headquarters moved to present location.Released Oracle7 for the PC.
1995
Reported gross revenues of almost $3 billion.
1997
Oracle8 released (supports more users, more data, higher availability)
1998
Oracle announces support for the Intel Linux operating system
1999
Oracle8i or Oracle 8.1.5 with Java integration
6
2000
Oracle8i Release 2.Oracle now not only the number one in Databases but also in ERP
Applications
2001 Oracle9i Release 9.0.1 shipped

Das könnte Ihnen auch gefallen