Creating tables is a fundamental task when working with databases, and Oracle SQL Developer is one of the most widely used tools for this purpose. Whether you're a seasoned database administrator or a beginner just starting out, knowing how to create tables efficiently is crucial. This tutorial is designed to guide you through the process of creating tables in Oracle SQL Developer. We'll cover each step in detail, from launching Oracle SQL Developer to executing the SQL command to create a table. By the end of this tutorial, you'll have a clear understanding of how to create tables in Oracle SQL Developer, setting a solid foundation for your database management tasks. Let's get started and learn how to create tables in Oracle SQL Developer.
Follow these steps to create a table in Oracle SQL developer.
- Open Oracle SQL Developer.
- Connect to the Database.
- On the left side, click on the schema name to expand the node.
- Then select Table node and do the right click on it.
- Select New Table option from the shortcut menu to create a table.
- A Create Table window will appear, as shown in below example.
- In the Create Table window, first, select the Advance checkbox at right to show all options for the table at the left side of the window.
- Then select the schema from the Schema drop-down list, by default it is showing the current schema.
- Specify the table name in the Name field. As shown in the above image.
- Choose the table type from the table type drop-down list.
- Then start by specifying columns for the table in the Column section of the window.
- Click on the PK column if you want to make the primary key column. Then specify the column name, it's data type and length, the column can be nullable or not and the default value if any for the column.
- Repeat the action for every new column and after completing the column creation, click on the OK button to create the table. You can also use other options in this window, such as Constraints, Indexes, Partitions as per your table requirement.
You have now created a new table using Oracle SQL Developer. The following is an example of the DDL statement for the newly created table.
CREATE TABLE SCOTT.EMP_CONTACT_INFO ( EMPNO NUMBER(10) NOT NULL , PRIMARY_CONTACT_NO VARCHAR2(20) NOT NULL , SECONDRY_CONTACT_NO VARCHAR2(20) , ADDR_LINE_1 VARCHAR2(100) NOT NULL , ADDR_LINE_2 VARCHAR2(100) , CITY VARCHAR2(50) DEFAULT 'UP' NOT NULL , STATE VARCHAR2(50) NOT NULL , CONSTRAINT EMP_CONTACT_INFO_PK PRIMARY KEY ( EMPNO ) ENABLE );