Home arrow Oracle arrow Creating a Table using Oracle 10G XE

Creating a Table using Oracle 10G XE

Oracle 10G XE provides a wizard to help you create a table. The wizard walks you through several steps for creating a table, taking you to the next step after you have entered valid entries for the current step. While scripts can be used to create a table, creating a table using the visual, form-based creation process is a lot simpler and less prone to errors. This tutorial describes a table to be created in the HR database with all the necessary ingredients for a typical database.

  1. Creating a Table using Oracle 10G XE
  2. Creating a table
  3. Creating a table using the Wizard
  4. Creating a table using the Wizard, continued
By: Jayaram Krishnaswamy
Rating: starstarstarstarstar / 37
September 19, 2006

print this article



Table is crucial

A table is an essential element of any relational database management system. Data stored in the columns and rows of a table, and the relationship that may exist between the various tables, is at the core of RDBMS. The creator of the table becomes the owner of the table. An owner cannot have two tables with the same name. Some of the other dos and don'ts for creating a table are:

The table name cannot use any of the keywords used in the system
It cannot be a combination of two names separated by a white space
The maximum length of a table is 28 characters.
The table name's first character should be alphabetic
The table name's other characters better be confined to numbers and 

In any case, if and when you violate the rules you do get a error message telling you what was wrong. In that sense, you are covered. Since the Wizard tells you immediately what is wrong in some cases, you know what you have to do to correct it.

We will start with a very simple example of creating just one table called Htek_Employees for the Htek company. The Employee table will consist solely of the Employee information such as:


Columns in the table

In addition to this, to associate this information uniquely to an individual an Employee_ID is also added. This table will have 16 columns. The 16 columns are the attributes of the Employee physically stored in a table. A row in the table may contain values for each of these columns. For example, for an employee whose Employee_ID is 1, the details are:

First_Name; John
Last_Name; Newcomb
Hire_Date: 2/1/1998
Birth_Date: 1/1/1980
Salary: $40000
Title: Supervisor
Address: 123 Cox Street
City: Princeville
State: NJ
ZIP: 08536
Home Phone: (738)123-1235
Office Phone: (738)234-2335
Call Phone: (981)222-2345
Email: jnewcomb@htek.com
Health Coverage (Yes/No): Yes
Notes: Dependable reliable employee

If the Employee_ID is known, everything about this employee should be available from this table.

Column Data Types

For each column in the above table, the type of information it contains is different. While names are represented by 'text', hire_date and birth_date consists of 'date' type information. The salary contains 'money' type information. Telephone numbers and the Zip code consists of numerals, but they are not number type; who will ever think of adding two zip codes, or subtracting one telephone number from another? So these are no different than names. So the different columns may be stored as different data types. The Oracle table designer gives you options from which you can choose the data type that you may want to assign.

>>> More Oracle Articles          >>> More By Jayaram Krishnaswamy

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates


Dev Shed Tutorial Topics: