DB2 SQL INTRODUCTION
SQL (structured query language) is used to acccess, manipulate or control the
access of rantional database. Databases like DB2, ORACLE, SQL SERVER 2000
support the SQL (Structured query language).
In relational database data represented as tables. Tables contains the data
in rows and column. Rows are called as records, columns called as fields.
PRIMARY KEY - PRIMARY KEY is one column or combination columns. This primary key
is to identify the records uniquely in the table. Applications/programs normally
proides PRIMARY KEY value to get the record values from the table. PRIMARY KEY
columns have the unique index (unqiue indexes wont allow duplicate values) defined
on them, so that processing time of SQL will be very less compare than the non-index columns.
FOREIGN KEY - FOREIGN KEY is one or more columns in a table that refers to the
primary key of another table. Through this key we can establish a relation between
two tables. If table B foreign key refers table A's primary key, DB2 / ORACLE wont
allow to enter the records into table B if the foreign key value in the input data
is not present in the table A's primary key list of values.
DB2 SQL (Structured query language) commands can be classified into 3 main categories
DDL, DML and DCL.
DDL ( Data Definition Language ) - These statements usaully used by DBA's or Senior
Programmers to create table spaces, tables , indexes etc...
DML (Data Manipulatoin Language ) - using these statements we can select, insert, update
and delete the data in the database.
DCL (Data Control Language ) - Using these statements DBA / user who has authority to
grant can grant accecss or revoke the authority of accessing DB2 database.
SQL TUTORIAL / DB2 / DB2 DATABASE /
MAINFRAME / DB2 / SQL (Sequel) Index DATABASE /
MAINFRAME / DB2 / SQL DB2 DATABASE /