What is the difference between DB2 operation statements and other database operation statements? The following is an example of a simple DB2 operation statement for your comparative study.
1. Create a table:
Create table table_name (
Column1 datatype [not null] [not null primary key],
Column2 datatype [not null],
...)
Note:
Datatype -- is the data format. For details, see the table.
Nut null-do you want to allow empty data ).
Primary key -- is the primary key of the table.
2. Change the table
Alter table table_name
Add column column_name datatype
Note: Add a column without deleting the syntax of a column.
Alter table table_name
Add primary key (column_name)
Note: You can change the table definition to set a column as a primary key.
Alter table table_name
Drop primary key (column_name)
Delete the definition of the primary key.
3. Create an index
Create index index_name on table_name (column_name)
Note: index the column of a table to increase the query speed.
4. Delete
Drop table_name
Drop index_name
The above is a simple introduction to the DB2 operation statements.
DB2 isolation level-read for implementation
Use of DB2 dynamic SQL
Implementation of DB2 circular Query
Introduction to DB2 information directory Center
DB2 cursor and usage