How to create table in Sql ?
CREATE TABLE in sql...........
###########################################################
The SQL CREATE TABLE statement is used to create a new table.
CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
constraint pk_persons
primary key (PersonID),
constraint fk_persons
foreign key primary_key_of_another_table
);
###########################################################
The SQL CREATE TABLE statement is used to create a new table.
CREATE TABLE Syntax
CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns )
FOREIGN KEY ()
UNIQUE()
constraint constraint_name
);
Example:
CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
constraint pk_persons
primary key (PersonID),
constraint fk_persons
foreign key primary_key_of_another_table
);
মন্তব্যসমূহ
একটি মন্তব্য পোস্ট করুন