Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Core Java and Spring Microservices
00:00
5 left

Core Java and Spring Microservices

MediumSQL · PostgreSQL

Problem

Core Java, Spring framework, Microservices, SQL. For the SQL portion, use the provided cardholders and transactions tables to identify qualifying cardholders for calendar year 2025. Include only approved transactions when calculating totals and counts.

Output

  1. One row per qualifying cardholder.
  2. Columns: cardholder_id, cardholder_name, approved_transaction_count, and approved_total.
  3. Include cardholders with at least two approved transactions and an approved total of at least 1000.
  4. Order by approved_total descending, then cardholder_id ascending.

Schema

cardholders
ColumnTypeDescription
cardholder_idPKINTUnique cardholder identifier
cardholder_nameVARCHAR(100)Cardholder display name
regionVARCHAR(50)Cardholder billing region
transactions
ColumnTypeDescription
transaction_idPKINTUnique transaction identifier
cardholder_idINTCardholder associated with the transaction
transaction_dateDATETransaction processing date
statusVARCHAR(20)Transaction processing status
amountDECIMAL(12,2)Transaction amount
Tablescardholderstransactions
Interviewer

Your question is Core Java and Spring Microservices. Start with the requirements and the two tables in the Question tab.

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.