SQL Server: T-SQL IDENTITY & FK #9. Write T-SQL against the sample schema.
Toolliyo Coach
Progressive help: Nudge → Guide → Approach. Full solution stays behind the Solution tab.
Editor is open — no login wall to practice.
| Test | Status | Details |
|---|
Ready — edit the code above and click Run or Submit.
CREATE TABLE Orders (
Id INT IDENTITY(1,1) PRIMARY KEY,
CustomerId INT NOT NULL,
Amount DECIMAL(12,2) NOT NULL,
CreatedAt DATETIME2 DEFAULT SYSUTCDATETIME(),
CONSTRAINT FK_Orders_Customer FOREIGN KEY (CustomerId) REFERENCES Customers(Id)
);
Prefer Coach (Nudge → Guide → Approach) before revealing. No forced signup.
T-SQL: TOP, IDENTITY, DATETIME2, CREATE OR ALTER, window functions — common in .NET/SQL Server interviews.
Sign in to save and review your submission history. You can still Run code on the Editor tab as a guest.
Sign in