Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
DB2 Study Material

DB2 Study Material

Ratings: (0)|Views: 1,133|Likes:
Published by api-19903451

More info:

Published by: api-19903451 on Dec 02, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less





DB2 Study Material
1.2.1 What is SQL?
Structured Query Language (SQL) is a standardized language for
and manipulating data in a relational database. In accordance with
relational model of data, the database is perceived as a set of
relationships are represented by values in tables, and data is
by specifying a result table that can be derived from one or more
DB2 transforms the specification of a result table into a sequence
internal operations that optimize data retrieval. This
occurs when the SQL statement is prepared. This transformation is
known asbinding.
1.2.2 Static SQL

The source form of a static SQL statement is embedded within an
application program written in a host language such as COBOL. The
statement is prepared before the program is executed and the

form of the statement persists beyond the execution of the program.
A source program containing static SQL statements must be processed
by an
SQL precompiler before it is compiled. The precompiler checks the

of the SQL statements, turns them into host language comments, and
generates host language statements to invoke DB2.

1.2.3 Dynamic SQL
A dynamic SQL statement is prepared during the execution of an SQL
application, and the operational form of the statement is not
The source form of the statement is a character string passed to DB2
by an
application program using the static SQL statement PREPARE or
IMMEDIATE. DB2 also uses dynamic SQL for system-directed access (1)
.1.2.4 Interactive SQL
In this book, interactive SQL refers to SQL statements submitted to
(SQL processor using file input). SPUFI prepares and executes these
statements dynamically.
1.2.6 Indexes
An index is an ordered set of pointers to rows of a base table.
index is based on the values of data in one or more columns. An
index is
an object that is separate from the data in the table. When you
define an
index using the CREATE INDEX statement, DB2 builds this structure
maintains it automatically.
Indexes can be used by DB2 to improve performance and ensure
In most cases, access to data is faster with an index. A table with
aunique index cannot have rows with identical keys.
1.2.7 Keys

A key is one or more columns that are identified as such in the
description of a table, an index, or a referential constraint.
The same column can be part of more than one key. A key composed of

more than
one column is called a composite key.

Activity (0)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
krsk77 liked this
Jaideep Dhiman liked this
B Ravi Kumar liked this
B Ravi Kumar liked this
Sampad Sekhar liked this
dogobello liked this
Jeganmanova liked this
prajeeshkv liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->