Software Developer - SQL Coding Problems
Software Developer - SQL Coding Problems
Table = employee
Example data:
Id (auto-inc primary key) Name
1 A
2 B
3 C
4 D
5 E
6 F
1 1 01/01/2021
2 2 01/01/2021
3 5 01/01/2021
4 6 01/01/2021
5 2 02/01/2021
6 3 02/01/2021
7 4 02/01/2021
8 2 03/01/2021
Write SQL queries to output the most regular (maximum attendance) and irregular employee
names.
Problem 2
Use the same tables as problem 1.
Write SQL query to output daily present/absent list like table below.
Date Employee Name Status
01/01/2021 A Present
01/01/2021 B Present
01/01/2021 C Absent
01/01/2021 D Absent
01/01/2021 E Present
01/01/2021 F Present
02/01/2021 A Absent
02/01/2021 B Present
… … …
Connecting to database
There is a public postgres database where you can try out your SQL queries.
Please do not delete the data or drop the tables.
If you are unable to connect please contact us.
● Host: heffalump.db.elephantsql.com
● Port: default (5432)
● User: llakhbgv
● Password: yEkAGp26fHEsCa-SyGwOZC0xqpx_wuBX
● Database: llakhbgv
If you would like to set up the database elsewhere you can use the following
scripts.