use shop
create table product(pid int primary key ,
pname nvarchar(30),
pp int,
sp int)
create table category(id int primary key,pname nvarchar(29))
alter table product add cID int foreign key references category(id)
create proc insrt
@id int,
@name nvarchar(10),
@pp int,
@sp int,
@cID int
as begin
insert into product values(@id,@name,@pp,@sp,@cID)
end
exec insrt 10,'i phone',33,332,11
No comments:
Post a Comment