sql data type and constraints

Viewed 23
create table product(
        Pcode int primary key,
        Pname varchar(225),
        Uprice int,
        Manufacture varchar(225)
);

INSERT INTO product 
                (Pcode ,  Pname, Uprice , Manufacture ) values
                (P01, 'washing powder', 120, 'Surf'),
                (P02, 'Tooth paste', 54, 'Colgate'),
                (P03, 'soap', 25, 'Lux'),
                (P04, 'Tooth paste', 65, 'Pepsodant'),
                (P05, 'soap', 38, 'Dove'),
                (P06, 'Sampoo', 245, 'Dove');
  • so, how may use 'Pcode 'as primary key char with integer i.e. P01,P02......P06

  • What should I take its data type and constraints.

0 Answers
Related