debit_card_specializing Database Schema

Database Description

Database for debit card specializing.

Schema Structure
Schema information not available for this database.
Example Queries

SQL Query:
SELECT CAST(SUM(IIF(T2.Currency = 'EUR', 1, 0)) AS FLOAT) * 100 / COUNT(T1.CustomerID) FROM transactions_1k AS T1 INNER JOIN customers AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Date = '2012-08-25'
Evidence:

'2012/8/25' can be represented by '2012-08-25'

Difficulty: simple

SQL Query:
SELECT SUBSTR(T2.Date, 1, 4) FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Currency = 'CZK' GROUP BY SUBSTR(T2.Date, 1, 4) ORDER BY SUM(T2.Consumption) DESC LIMIT 1
Evidence:

The first 4 strings of the Date values in the yearmonth table can represent year.

Difficulty: moderate

SQL Query:
SELECT T2.Consumption FROM transactions_1k AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Price / T1.Amount > 29.00 AND T1.ProductID = 5 AND T2.Date = '201208'
Evidence:

August of 2012 refers to the Date value = '201208' ; Price per unit of product = Price / Amount;

Difficulty: moderate

SQL Query:
SELECT SUM(Consumption) FROM yearmonth WHERE SUBSTR(Date, 1, 4) = '2012' GROUP BY SUBSTR(Date, 5, 2) ORDER BY SUM(Consumption) DESC LIMIT 1
Evidence:

The first 4 strings of the Date values in the yearmonth table can represent year; The 5th and 6th string of the date can refer to month.

Difficulty: simple

SQL Query:
SELECT T1.CustomerID FROM customers AS T1 INNER JOIN yearmonth AS T2 ON T1.CustomerID = T2.CustomerID WHERE T1.Segment = 'LAM' AND SUBSTR(T2.Date, 1, 4) = '2012' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1
Evidence:

Year 2012 can be presented as Between 201201 And 201212; The first 4 strings of the Date values in the yearmonth table can represent year.

Difficulty: moderate
Back to Database Explorer