SQL Server: T-SQL stored procedure raise #44. 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.
-- SQL Server sample schema
CREATE TABLE Departments (Id INT PRIMARY KEY, Name NVARCHAR(100));
CREATE TABLE Employees (Id INT PRIMARY KEY, Name NVARCHAR(100), Salary INT, DeptId INT, Hired DATE);
INSERT INTO Departments VALUES (1,'Engineering'),(2,'Sales');
INSERT INTO Employees VALUES (1,'Alice',90000,1,'2020-01-15'),(2,'Bob',75000,1,'2021-03-01'),(3,'Carol',82000,2,'2019-06-20'),(4,'Dan',68000,2,'2022-11-05');
CREATE OR ALTER PROCEDURE dbo.RaiseSalary
@EmpId INT,
@Pct DECIMAL(5,2)
AS
BEGIN
SET NOCOUNT ON;
UPDATE Employees SET Salary = Salary * (1 + @Pct/100.0) WHERE Id = @EmpId;
END;
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