Syntax :-
CREATE TABLE table name
(
Column_name1 data-type (size),
Column_name2 data-type (size),
Column_name3 data-type (size)
);
Ex :-
CREATE TABLE my_tab
(
name varchar (30),
roll int (4),
address varchar (100)
);
Another way to create a table
Syntax :-
CREATE TABLE table name
(
Column_name1 data-type (size) [constraints],
Column_name2 data-type (size) [constraints],
Column_name3 data-type (size) [constraints]
);
Ex :-
CREATE TABLE my_tab
(
name varchar (30) NOT NULL,
roll int (4) PRIMARY KEY,
address varchar (100)
);
Guidelines for creation of Table
1. Table name should start with an alphabet.
2. In table name, blank spaces and single quotes are not allowed.
3. Reserve words of that RDBMS/DBMS cannot be used as table name.
4. Proper data type and size should be specified.
5. Unique column name should be specified.
CREATE TABLE table name
(
Column_name1 data-type (size),
Column_name2 data-type (size),
Column_name3 data-type (size)
);
Ex :-
CREATE TABLE my_tab
(
name varchar (30),
roll int (4),
address varchar (100)
);
Another way to create a table
Syntax :-
CREATE TABLE table name
(
Column_name1 data-type (size) [constraints],
Column_name2 data-type (size) [constraints],
Column_name3 data-type (size) [constraints]
);
Ex :-
CREATE TABLE my_tab
(
name varchar (30) NOT NULL,
roll int (4) PRIMARY KEY,
address varchar (100)
);
Guidelines for creation of Table
1. Table name should start with an alphabet.
2. In table name, blank spaces and single quotes are not allowed.
3. Reserve words of that RDBMS/DBMS cannot be used as table name.
4. Proper data type and size should be specified.
5. Unique column name should be specified.
0 Comments:
Post a Comment