Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
3Activity
0 of .
Results for:
No results containing your search query
P. 1
Database Objects

Database Objects

Ratings: (0)|Views: 100|Likes:
Published by yogeshpachpute

More info:

Published by: yogeshpachpute on Sep 27, 2009
Copyright:Attribution Non-commercial

Availability:

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

03/31/2012

pdf

text

original

 
Database objects
Presented by DB2 Developer Domain
ibm.com/software/database/db2
Table of Contents
If you're viewing this document online, you can click any of the topics below to link directly to that section.
1. Introduction..............................................................22. Data types..............................................................33. Tables...................................................................84. Constraints..............................................................125. Views.....................................................................15 6. Indexes...................................................................197. Summary, resources and feedback.................................22
Database objects Page 1 of 23
 
Section 1. IntroductionWhat this tutorial is about
This tutorial discusses data types, tables, views and indexes as defined by DB2Universal Database. It explains the features of these objects, how to create andmanipulate them using Structured Query Language (SQL) and how they can be used inan application.This tutorial is the fifth in a series of six tutorials that you can use to help you preparefor the DB2 Fundamentals Certification (Exam 512). The material in this tutorialprimarily covers the objectives in "Section 5. Database Objects." You can view theseobjectives at:
.In this tutorial, you will learn about:
The built-in data types provided by DB2 and which to use when defining a table
The concepts of advanced data types
Creating tables, views and indexes in a DB2 database
Unique constraints, referential integrity constraints and table check constraints andhow to use them
How to use views to restrict access to data
The features of indexes and how to use themYou do not need a copy of DB2 Universal Database to complete this tutorial. However,you can download a trial version of
Enterprise Edition.
About the author
Hana Curtis is a database consultant at the IBM Toronto Lab and works with IBMBusiness Partners to enable their applications to DB2. Prior to 1997, she was amember of the DB2 development team responsible for the data manager component.She holds the following certifications:
IBM Certified Solutions Expert - DB2 UDB V7.1 Database Administration for UNIX,Windows, and OS/2
IBM Certified Solutions Expert - DB2 UDB V7.1 Family Application Development
IBM Certified Specialist - DB2 V7.1 User
ibm.com/software/database/db2
Presented by DB2 Developer DomainPage 2 of 23 Database objects
 
Section 2. Data typesCategories of data types
DB2 provides a rich and flexible assortment of data types. DB2 comes with basic datatypes such as INTEGER, CHAR and DATE and also facilities to create user-defineddata types which give the programmer the ability to create complex, non-traditionaldata types suited to today's complex programming environments. Choosing which typeto use depends on the type and range of information that will be stored in the column.The built-in data types are catagorized as follows:
Numeric
String
Datetime
DatalinkThe user-defined data types are catalogorized as:
User-defined distinct type
User-defined structured type
User-defined reference type
Numeric data types
There are three categories of numeric data types. These types vary in the range andprecision of numeric data they can store.
Integer
SMALLINT, INTEGER and BIGINT are used to store numbers which are integers.For example, an inventory count could be defined as INTEGER. SMALLINT canstore integers from -32768 to 32767 in two bytes. INTEGER can store integers from-2,147,483,648 to 2,147,483,647 in four bytes. BIGINT can store integers from
Presented by DB2 Developer Domain
ibm.com/software/database/db2
Database objects Page 3 of 23

You're Reading a Free Preview

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