BrainWare-test/ProjectDB/Tables/orderproduct.sql
2018-06-05 12:14:15 -04:00

11 lines
429 B
Transact-SQL

CREATE TABLE [dbo].[orderproduct]
(
[order_id] int NOT NULL,
[product_id] int NOT NULL,
[price] decimal(18,2) NOT NULL,
[quantity] int NOT NULL,
CONSTRAINT [PK_orderproduct] PRIMARY KEY ([order_id], [product_id]),
CONSTRAINT [FK_orderproduct_product] FOREIGN KEY ([product_id]) REFERENCES [product]([product_id]),
CONSTRAINT [FK_orderproduct_order] FOREIGN KEY ([order_id]) REFERENCES [order]([order_id])
)