Wednesday, September 2, 2009

How to create a table in Oracle

We can create the table using the Query:

Syntax :

CREATE TABLE tableName (fieldName1 datatype(size), fieldName2 datatype(size) ,........etc);


Example:

CREATE TABLE STUDENT
(
STUDENT_ID NUMBER(5),
STUDENT_NAME VARCHAR(30),
CLASS VARCHAR(5)
);

In the above example STUDENT is the table name, STUDENT_ID , STUDENT_NAME ,
CLASS are the columns of the table student with the respective data types.

No comments:

Post a Comment

Please comment on this