Oracle 8i: Fundamental Concepts of SQL

Oracle SQL Fundamental Concepts

Definition: Structured Query Language (SQL) is the set of statements with which all programs and users access data in an Oracle database.

RDBMS: Dr. E. F. Codd published the paper, "A Relational Model of Data for Large Shared Data Banks", in June 1970. Codd’s model is now accepted as the definitive model for relational database management systems (RDBMS). Today, SQL is accepted as the standard RDBMS language.

What is SQL & its features:
SQL is a data sub language. The purpose of SQL is to provide an interface to a relational database such as Oracle, and all SQL statements are instructions to the database. 

Among the features of SQL are the following:
It processes sets of data as groups rather than as individual units.
It provides automatic navigation to the data.
It uses statements that are complex and powerful individually, and that therefore stand alone. Flow-control statements were not part of SQL originally, but they are found in the recently accepted optional part of SQL, ISO/IEC

Standards & Compliance:
The latest SQL standard published by ANSI and ISO is often called SQL92 (and sometimes SQL2). The formal names of the new standard are:
ANSI X3.135-1992, "Database Language SQL"
ISO/IEC 9075:1992, "Database Language SQL"

SQL92 defines four levels of compliance: Entry, Transitional, Intermediate, and Full.
A conforming SQL implementation must support at least Entry SQL. Oracle8i fully supports Entry SQL and has many features that conform to Transitional, Intermediate, or Full SQL.

Use of SQL
Essentially, SQL lets you work with data at the logical level. You need to be concerned with the implementation details only when you want to manipulate the data. 

SQL provides statements for a variety of tasks, including:
Querying data
Inserting, updating, and deleting rows in a table
Creating, replacing, altering, and dropping objects
Controlling access to the database and its objects
Guaranteeing database consistency and integrity

SQL unifies all of the above tasks in one consistent language.

Porting & Support
All major relational database management systems support SQL, so you can transfer all skills you have gained with SQL from one database to another. In addition, all programs written in SQL are portable. They can often be moved from one database to another with very little modification.

Embedded SQL:
Embedded SQL refers to the use of standard SQL statements embedded within a procedural programming language.

Lexical Conventions:
1. An Oracle SQL statement can include one or more tabs, carriage
returns, spaces, or comments anywhere a space occurs within the definition of the
statement. 
2. Case is insignificant in reserved words, keywords, identifiers and parameters.
However, case is significant in text literals and quoted names.

Basic Elements of SQL:

The basic elements of Oracle SQL are simplest building blocks of SQL statements.
Literals (Text, Integer, Number), Datatypes, Format Models, Nulls, Pseudocolumns, Comments, Database Objects, Schema Object Names and Qualifiers, Referring to Schema Objects and Parts

Literals

The terms literal and constant value are synonymous and refer to a fixed data value. Character literals are enclosed in single quotation marks.

You can specify character literals with the ’text’ notation, national character literals with the N’text’ notation, and numeric literals with the integer or number notation, depending on the context of the literal.

Datatypes
Each literal or column value manipulated by Oracle has a datatype. A value’s datatype associates a fixed set of properties with the value. These properties cause Oracle to treat values of one datatype differently from values of another.

Based on Oracle 8i SQL Reference

Back to PoSki CyberSMART Online Tutorials: Main Page