Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Solution 1
/* Problem: Write a SQL statement to list all employees alphabetically by last name (A-Z). Add your solution at the end. Expected Output: EmployeeId FirstName LastName 2 Liam Brolin 1 Noah Clooney 6 William Damon 3 Mason Farrell 9 Ethan Firth 5 Jacob Foxx 7 Olivia Johansson 4 Emma Jolie 8 Isabella Portman 10 Emily Theron */ -- Create a table called Employees CREATE TABLE Employees ( EmployeeId INT PRIMARY KEY, FirstName VARCHAR(200), LastName VARCHAR(200), ManagerEmployeeId INT) GO -- Fill Employee table INSERT INTO Employees VALUES(1, 'Noah', 'Clooney', NULL) INSERT INTO Employees VALUES(2, 'Liam', 'Brolin', 1) INSERT INTO Employees VALUES(3, 'Mason', 'Farrell', 1) INSERT INTO Employees VALUES(4, 'Emma', 'Jolie', 1) INSERT INTO Employees VALUES(5, 'Jacob', 'Foxx', 2) INSERT INTO Employees VALUES(6, 'William', 'Damon', 4) INSERT INTO Employees VALUES(7, 'Olivia', 'Johansson', 5) INSERT INTO Employees VALUES(8, 'Isabella', 'Portman', 1) INSERT INTO Employees VALUES(9, 'Ethan', 'Firth', 6) INSERT INTO Employees VALUES(10, 'Emily', 'Theron', 7) GO ------------------------------------------------------------------ -- Sql Server 2014 Express Edition - 12.0.2000.8 -- Solution. ------------------------------------------------------------------ SELECT EmployeeId, FirstName, LastName FROM Employees ORDER BY LastName
run
|
edit
|
history
|
help
0
https://rextester.com/IYRZ86271
SCHOOL-BUILD
hdudh
count events by 2 shift cycles using derived table
2021.02.24 Lab 4
FIRST DATABASE
SqlServer1282018
SQl_QUEST_2_PRESENTATION_IMG_COUNT
wall
test44