2 Day Developer > Managing Database Objects > Managing Tables > Creating a Table
Creating a Table |
Previous |
Next |
You can use the Object Browser page to create a table. The procedure in this section creates a table that contains personal information for employees in the employees
sample table.
To create a table:
Log in to the Database Home Page. See "Logging in to the Database Home Page".
On the Database Home Page, click the Object Browser icon.
In the object list under Create, select Table.
In the Table Name field, enter the name of the table (personal_info
).
Enter the following column names and datatypes and enable the NOT
NULL
constraint where designated. The NOT
NULL
constraint specifies that a value must be entered in the column.
employee_id NUMBER(6,0) NOT NULL
birth_date DATE NOT NULL
social_security_id VARCHAR2(12) NOT NULL
marital status VARCHAR2(10)
dependents_claimed NUMBER(2,0)
contact_name VARCHAR2(45) NOT NULL
contact_phone VARCHAR2(20) NOT NULL
contact_address VARCHAR2(80) NOT NULL
For information about datatypes, see "Using Datatypes". For information about the NOT
NULL
constraint, see "NOT NULL Constraint".
Ensure that Preserve Case has been left unchecked so that names are stored in the default manner (uppercase), which avoids any extra overhead.
After you have enter the column information, click Next.
On the Primary Key page, do not create a key at this time. Click the Next button. See "Adding a Primary Key Constraint".
On the Foreign Key page, do not create a key at this time. Click the Next button. See "Adding a Foreign Key Constraint".
On the Constraints page, do not create a constraint at this time. Click the Finish button. See "Adding a Unique Constraint" and "Adding a Check Constraint".
On the Create Table page, click the SQL button to view the SQL statements that produce the table. This option shows the statement even if it is incomplete. You need to complete your input to see the complete SQL statement when using this option.
Click the Create button to create the table.