Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Attendance Management Schema and SQL

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Attendance Management Schema and SQL. Start with the requirements and the two tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Design a database schema/tables for a company's employee attendance management system using two tables, and write simple SQL queries against it.

Asked in the Virtual Onsite stage. Round 1 of VO.

Output

  1. Provide a two-table schema that can store employees and their attendance records.
  2. Write SQL queries that return common attendance summaries, such as daily presence and per-employee totals.
  3. Keep the result sets clearly ordered so the output is deterministic.

Schema

employees
ColumnTypeDescription
employee_idPKINTUnique employee identifier
employee_nameVARCHAR(100)Employee full name
departmentVARCHAR(100)Employee department
attendance_records
ColumnTypeDescription
attendance_idPKINTUnique attendance record identifier
employee_idINTReferences employees.employee_id
attendance_dateDATEDate of attendance
statusVARCHAR(20)Attendance status such as Present or Absent
check_in_timeTIMECheck-in time when available
Tablesemployeesattendance_records
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results