create table Product(
ProId int identity(1,1) primary key,
ProName nvarchar(50) not null,
ProInfo nvarchar(50),
danjia money
--其他相关信息
)
create table Orders(
OrdersId int identity(1,1) primary key,
OrdersDate datetime default getdate(),
OrdersMoney money,
--其他相关信息
)
create table sOrders(
OrdersId int foreign key(OrdersId) references Orders(OrdersId)
on update cascade on delete cascade,
sid int,
constraint sid primary key(OrdersId,sid),
ProId int foreign key(ProId) references Product(ProId)
on update cascade on delete cascade,
const decimal(20,2),
--其他相关信息
)