How to create table in database-Oracle


For create a table in a database the CREATE TABLE statement is used.

Syntax for create a table in database

CREATE TABLE table_name
(
column1 datatype (size),
column2 datatype (size),
...
column_n datatype (size)
);

For create a table three parameter is used

The column_name parameters specify the names of the columns of the table.

The data_type parameter specifies what type of data the column can hold (e.g. varchar, integer, decimal, date, etc.).

The data_type parameter specifies the length of the column.

Example

CREATE TABLE students
(
student_id number(30) NOT NULL,
student_name varchar2(70) NOT NULL,
class varchar2(x)
);

Here Student is the table name and LastName, FirstName, Class is name of the column.

Varchar is a data type and the maximum length of this field are 100 character.








Connection failed: SQLSTATE[28000] [1045] Access denied for user 'studentdb'@'localhost' (using password: YES)

Subscribe