How to Create Table in Oracle SQL Developer?

How to Create Table in Oracle SQL Developer?

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.

  1. Open Oracle SQL Developer.
  2. Connect to the Database.
  3. On the left side, click on the schema name to expand the node.
  4. Then select Table node and do the right click on it.
  5. Select New Table option from the shortcut menu to create a table.
  6. A Create Table window will appear, as shown in below example.

create table in Oracle SQL developer

  1. 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.
  2. Then select the schema from the Schema drop-down list, by default it is showing the current schema.
  3. Specify the table name in the Name field. As shown in the above image.
  4. Choose the table type from the table type drop-down list.
  5. Then start by specifying columns for the table in the Column section of the window.
  6. 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.
  7. 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 
);

See also:

This Post Has 2 Comments

  1. Mithilesh Kumar Gupta

    Hi, I am Mithillesh Gupta, I want to practice PLSQL so I install a SQL Developer and connect with MYSQL workbench and it connect status is success and fetching data and ,insert data in table is working but it doesn't allow to create table and in PLSQL it does not working giving error "check the manual that corresponds to your MySQL server version for the right syntax to use near........." every time.so what I am doing wrong,
    Should I connect to an Oracle database.

    1. Vinish Kapoor

      For PL/SQL, you need to use Oracle Database.

Comments are closed.