MCQs > IT & Programming > SQL >

Consider the following Attendance table which contains an employee attendance record for a company:

EmployeeID (int), LoginTime (time), LogoutTime (time)

Which of these SELECT statements will list the employee ID that has logged-in most recently?


SQL MCQs

Consider the following Attendance table which contains an employee attendance record for a company:

EmployeeID (int), LoginTime (time), LogoutTime (time)

Which of these SELECT statements will list the employee ID that has logged-in most recently?


Answer

Correct Answer:

SELECT TOP 1 a.EmployeeID

FROM Attendance a

WHERE a.LoginTime = (SELECT MAX(b.LoginTime) FROM Attendance b)

Explanation:

Note: This Question is unanswered, help us to find answer for this one

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

SQL Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it