SQL Case Study
SQL Case Study
+91-7022374614
You are a database developer of an international bank. You are responsible for managing the bank
database. You want to use the data to answer a few questions about your customers regarding
withdrawal, deposit etc especially about the transaction amount on a particular date across various
regions of the world. Perform SQL queries to get the key insights of a customer.
Dataset :
● Continent
The Continent Table has two attributes i.e. region_id and region_name where region_name consists
of different continents such as Asia, Europe, Africa etc assigned with the unique region id.
● Customers
The Customers Table has four attributes named customer_id, region_id, start_date and end_date
which consists of 3500 records.
● Transaction
Finally, the Transaction Table contains around 5850 records and has four attributes named
customer_id, txn_date, txn_type and txn_amount.
1) Display the count of customer in each region who has done the transaction in year 2020
3) Display customer id, region name and transaction amount where transaction type is deposit and
transaction amount > 2000.
5) Display the detail of customer id, region name, transaction type and transaction amount for the
minimum transaction amount in deposit.
6) Create a stored procedure to display details of customer and transaction table where transaction
date is greater than Jun 2020.
9) Create a user defined function to add 10% of the transaction amount in a table.
10) Create a user defined function to find the total transaction amount for a given transaction type.
11) Create a table value function which comprises of the following columns customer_id,
region_id ,txn_date , txn_type , txn_amount which will retrieve data from the above table.
12) Create a try catch block to print a region id and region name in a single column.
13) Create a try catch block to insert a value in the continent table.
16) Create a trigger to prevent login of the same user id in multiple pages.
18) Create a pivot table to display the total purchase, withdrawal and deposit for all the customers.