Creating a Table

Previous
Previous
Next
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:

  1. Log in to the Database Home Page. See "Logging in to the Database Home Page".

  2. On the Database Home Page, click the Object Browser icon.

  3. In the object list under Create, select Table.

  4. In the Table Name field, enter the name of the table (personal_info).

  5. 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.

  6. After you have enter the column information, click Next.

  7. On the Primary Key page, do not create a key at this time. Click the Next button. See "Adding a Primary Key Constraint".

  8. On the Foreign Key page, do not create a key at this time. Click the Next button. See "Adding a Foreign Key Constraint".

  9. 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".

  10. 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.

  11. Click the Create button to create the table.