Files
School/Anul 3/Semestrul 2/Licenta/Practical/SqlScripts/OrderTableCreate.sql
T
2025-07-03 20:56:38 +03:00

18 lines
534 B
Transact-SQL

CREATE TABLE [dbo].[Orders]
(
[hmy] INT IDENTITY (1, 1) NOT NULL,
[hCustomer] NVARCHAR (MAX) NOT NULL,
[sStatus] INT NOT NULL DEFAULT 0,
CONSTRAINT [PK_Orders] PRIMARY KEY CLUSTERED ([hmy] ASC)
);
CREATE TABLE [dbo].[OrderItems]
(
[hmy] INT IDENTITY (1, 1) NOT NULL,
[hOrder] INT NOT NULL,
[hProduct] INT NOT NULL,
[iQuantity] INT NOT NULL DEFAULT 1,
[dPrice] DECIMAL (18, 2) NOT NULL,
[sProductName] NVARCHAR (MAX) NOT NULL,
CONSTRAINT [PK_OrderItems] PRIMARY KEY CLUSTERED ([hmy] ASC)
);