Week2 Assessment
Week2 Assessment
Create Bank database with below tables and insert below sample data.
BANK
create database bank;
use bank;
CREATE TABLE customer_master(
CUSTOMER_NUMBER VARCHAR(6),
FIRSTNAME VARCHAR(30),
middlename VARCHAR(30),
lastname VARCHAR(30),
CUSTOMER_CITY VARCHAR(15),
CUSTOMER_CONTACT_NO VARCHAR(10),
occupation VARCHAR(10),
CUSTOMER_DATE_OF_BIRTH DATE,
CONSTRAINT customer_custid_pk PRIMARY KEY (CUSTOMER_NUMBER));
QUERIES
Write a query to display the number of customer’s from Delhi. Give the count an
alias name of Cust_Count.
Write a query to display the customer number, customer firstname, account number
for the customer’s whose accounts were created after 15th of any month. Display the
records sorted in ascending order based on customer number and then by account
number.
Write a query to display the number of customers who have registration but no
account in the bank. Give the alias name as Count_Customer for number of customers.
Write a query to display the total number of withdrawals and total number of
deposits being done by customer whose customer number ends with 001. The query
should display transaction type and the number of transactions. Give an alias name
as Trans_Count for number of transactions. Display the records sorted in ascending
order based on transaction type.