Wednesday, 13 December 2017

Learn Sql server in hindi/urdu part-24 (one to many relationship with pr...







create table customer

(

c_id int identity primary key,

c_name nvarchar(20) not null

)



insert into customer

values('asim')

insert into customer

values('basit')

insert into customer

values('danish')

insert into customer

values('Ebad')



select * from customer



create table product

(

p_id int identity primary key,

p_name nvarchar(20) not null



)



select * from product







create table tblorder

(

o_id int identity primary key,

o_product_id int foreign key references product(p_id),

o_date datetime,

o_c_id int foreign key references customer(c_id),

)





insert into tblorder

values(3,GETDATE(),4)





select c.c_id,c.c_name,p.p_name,o.o_id,o.o_date from tblorder o inner join product p on p.p_id=o.o_product_id inner join customer c on c.c_id=o.o_c_id








No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...