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 AVG(Amount) FROM transactions_1k WHERE Date LIKE '2012-01%'
Evidence:

In January, 2012 means Date contains '2012-01'

Difficulty: simple

SQL Query:
SELECT SUM(Consumption) FROM yearmonth WHERE CustomerID = 6 AND Date BETWEEN '201308' AND '201311'
Evidence:

Between August And November 2013 refers to Between 201308 And 201311; 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 T2.Date = '201206' AND T1.Segment = 'SME' GROUP BY T1.CustomerID ORDER BY SUM(T2.Consumption) ASC LIMIT 1
Evidence:

June 2012 refers to yearmonth.date = '201206'

Difficulty: simple

SQL Query:
SELECT Country , ( SELECT COUNT(GasStationID) FROM gasstations WHERE Segment = 'Value for money' ) FROM gasstations WHERE Segment = 'Value for money' GROUP BY Country ORDER BY COUNT(GasStationID) DESC LIMIT 1
Difficulty: simple

SQL Query:
SELECT CAST(SUM(IIF(Currency = 'EUR', 1, 0)) AS FLOAT) / SUM(IIF(Currency = 'CZK', 1, 0)) AS ratio FROM customers
Evidence:

ratio of customers who pay in EUR against customers who pay in CZK = count(Currency = 'EUR') / count(Currency = 'CZK').

Difficulty: simple
Back to Database Explorer