Menu

Monday, 23 December 2013

Make Table In Sql Server

Create Table tbl_cust
(Cust_ID int Not Null,Cust_Name nvarchar(20) Null,Cust_Age int Null check (Cust_age >= 18),Cust_Address Char(50) Null,Cust_Salary Decimal(18,2),Primary Key(Cust_ID));        

Note  
Also specify column[cust_id(primary key)] property’s ----- Indentity specification is  yes at save time table.
Insert Query 

INSERT INTO tbl_customer (Cust_Name,Cust_Age,Cust_Salary,Cust_Salary) VALUES(‘munim ’,’50’,’40,000’,’pk-215 kanpur’);
INSERT INTO tbl_ customer (Cust_Name,Cust_Age,Cust_Salary,Cust_Salary) VALUES(‘mahesh ’,’30’,’25,00’,’ok 412 rbl’);
INSERT INTO tbl_ customer (Cust_Name,Cust_Age,Cust_Salary,Cust_Salary) VALUES(‘suresh ’,’24’,’35,000’,’h n 215 rbl’);
INSERT INTO tbl_ customer (Cust_Name,Cust_Age,Cust_Salary,Cust_Salary) VALUES(‘manish ’,’26’,’15,000’,’ck 10/20 vns’);
INSERT INTO tbl_ customer (Cust_Name,Cust_Age,Cust_Salary,Cust_Salary) VALUES(‘mac ’,’25’,’20,000’,’b-4/58 varanasi’);

No comments: