Monday, 12 February 2018

inner join in sql server

create database shop

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