All problems

Who Were Our Earliest Customers?

easySQLDatesFiltering

Loopwire is writing a case study and wants to interview the companies that took a chance on the product before it was established — the ones that signed up in 2022, when the customer list was still short.

Signup dates are stored as plain text in the form YYYY-MM-DD. That layout is chosen deliberately: with the year first and every part padded to a fixed width, comparing two of these strings character by character gives the same answer as comparing the dates themselves. The cut-off is the turn of the year, and a company that signed up on 1 January 2023 is not an early customer.

accounts — one row per customer company. signup_date is the day they became a customer, as text.

id company_name industry signup_date
1 Northwind Traders retail 2022-11-03
2 Vertex Analytics software 2022-12-15
3 Bluepeak Logistics logistics 2023-01-20
4 Fernwood Studio media 2023-02-05
5 Cobalt Health healthcare 2023-02-18
6 Ridgeline Capital finance 2023-03-01
7 Sable & Co retail 2023-03-22
8 Hearth Robotics manufacturing 2023-04-10

The table already exists in the database — there is nothing to create or load.

Task: Write a query returning a single column, company_name, for every company that signed up before 1 January 2023, earliest signup first.

Example output — shape only, on invented accounts. The sequence is by signup date, so it is not alphabetical:

company_name
Quillstone Media
Alder Freight

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…