DEVELOPING DATABASES USING ORACLE 9i
STEP 1
Before creating a table we have to determine what are the field names of the table.
In our example the Table name is ORACLE_USER.
The field names are as follows:
USER_ID Stands for Identification
USER_FNAME Stands for User First Name
USER_LNAME Stands for user Last Name
Before creating our table, We have to determine the Primary Key field. The purpose of the primary key is to identify the record. The primary key should not contain a null value. Similarly the primary key should not contain a duplicate value.
In our example the primary key field is the USER_ID.
DATA TYPES
In database development, data types are to be identified.
There are few sata types. They are VARCHAR2, NUMBER, DATE etc.
VARCHAR2 is used for character data. NMBER is used for numeric data. DATE is used for handling DATE as its name implies.
CREATING A TABLE IN ORACLE 9i
TABLE NAME: ORACLE_USER
CREATE TABLE ORACLE_USER
(
USER_ID VARCHAR2 (15) NOT NULL,
USER_FNAME VARCHAR2 (20) NOT NULL,
USER_LNAME VARCHAR2 (20) NOT NULL ...
/* USER_ID PRIMARY KEY */
CONSTRAINT USER_PK PRIMARY KEY (USER_ID)
);
Sunday, October 28, 2007
Subscribe to:
Posts (Atom)