Basic Oracle Concepts and Programming Question:
Download Job Interview Questions and Answers PDF
How To Create a New Table in Oracle?
Answer:
If you want to create a new table in your own schema, you can log into the server with your account, and use the CREATE TABLE statement. The following script shows you how to create a table:
>.insqlplus /nolog
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE tip (id NUMBER(5) PRIMARY KEY,
2 subject VARCHAR(80) NOT NULL,
3 description VARCHAR(256) NOT NULL,
4 create_date DATE DEFAULT (sysdate));
Table created.
This scripts creates a testing table called "tip" with 4 columns in the schema associated with the log in account "HR".
>.insqlplus /nolog
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE tip (id NUMBER(5) PRIMARY KEY,
2 subject VARCHAR(80) NOT NULL,
3 description VARCHAR(256) NOT NULL,
4 create_date DATE DEFAULT (sysdate));
Table created.
This scripts creates a testing table called "tip" with 4 columns in the schema associated with the log in account "HR".
Download Oracle Database Interview Questions And Answers
PDF
Previous Question | Next Question |
What Are DDL Statements in Oracle? | How To Create a New Table by Selecting Rows from Another Table? |