0% found this document useful (0 votes)
4 views2 pages

Assignment 5

The document outlines various SQL join operations to query data from tables related to banks, customers, and accounts. It includes specific queries for CROSS JOIN, NATURAL JOIN, CONDITIONAL JOIN, EQUI JOIN, SELF JOIN, INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN, each with distinct objectives such as listing customer details, account statuses, and bank information. The queries aim to extract comprehensive insights about customer accounts and their relationships with banks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Assignment 5

The document outlines various SQL join operations to query data from tables related to banks, customers, and accounts. It includes specific queries for CROSS JOIN, NATURAL JOIN, CONDITIONAL JOIN, EQUI JOIN, SELF JOIN, INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN, each with distinct objectives such as listing customer details, account statuses, and bank information. The queries aim to extract comprehensive insights about customer accounts and their relationships with banks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT : 5

Based on the tables(Bank, Customer, Account) from Assignment 4


CROSS JOIN :

QUERY 1: List all combinations of customers, their associated bank, and account details.

QUERY 2: Find the customers with ‘Active’ savings accounts from specific banks.

NATURAL JOIN :

QUERY 1: List customers and bank details of those who have ‘Dormant’ accounts.

QUERY 2: Display the customer with bank ID, name, and location if they have more than one account in the
same bank.

CONDITIONAL JOIN :

QUERY 1: List all accounts with customer and bank information for accounts created after a specific date.

QUERY 2: Display customers and their banks where the bank location is different from the customer's city.

EQUI JOIN :

QUERY 1: Get the customer’s name and account status for account/s in a specific bank.

QUERY 2: List customers whose accounts are either ‘Current’ or ‘Fixed’ deposits, and their associated banks.

SELF JOIN :

QUERY 1: Find customers who have more than one account in different cities within the same bank.

QUERY 2: Compare the account opening dates of two accounts from the same customer in the same bank.
INNER JOIN :

QUERY 1: Find the customer and bank details of the account that is ‘Closed’.

QUERY 2: List customers with different investment types and loan types in a particular branch of HDFC Bank.

LEFT OUTER JOIN :

QUERY 1: Get all the details of the active customers and their bank names.

QUERY 2: List banks along with the total number of customers, even if zero customers exist.

QUERY 3: List banks with a total balance of all their customers.

RIGHT OUTER JOIN :

QUERY 1: Find all accounts and customers for banks that have at least one customer.

QUERY 2: Find customers who have accounts in multiple banks but no ‘Active’ account in any.

QUERY 3: [Add a new attribute bank_status : ‘Operational’, ‘Merged’, ‘Suspended’]

Find customers who have accounts, but the bank they belong to is ‘Suspended’.

FULL OUTER JOIN :

QUERY 1: Find unmatched customers and unmatched banks separately.

QUERY 2: Find customers with no account but linked to a bank.

QUERY 3: Find customers with multiple accounts in different banks.

You might also like