0% found this document useful (0 votes)
63 views4 pages

CSE370 09 Lab Assignment03

The document contains a series of SQL queries related to a database assignment for CSE370: Database Systems. Each query retrieves specific information from a database, such as customer names, loan details, and account balances, using various join operations and conditions. The assignment appears to be for Spring 2025 and includes student identification details.

Uploaded by

adonahmed0011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views4 pages

CSE370 09 Lab Assignment03

The document contains a series of SQL queries related to a database assignment for CSE370: Database Systems. Each query retrieves specific information from a database, such as customer names, loan details, and account balances, using various join operations and conditions. The assignment appears to be for Spring 2025 and includes student identification details.

Uploaded by

adonahmed0011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CSE370 : Database Systems

Assignment 03 | Spring 2025


ID : 23101130| Name : Adon Ahmed Joy

No 1 Query select c.customer_name, b.loan_number from customer c


(as Plain Text) join borrower b on c.customer_id = b.customer_id
join loan l on b.loan_number = l.loan_number
where l.branch_name = "Downtown";

No 1 SS
(of Query &
Output
in Shell)

No 2 Query select c1.customer_name as Customer1, c2.customer_name as Customer2 , c1.customer_city as


(as Plain Text) City
from customer c1
join customer c2 on c1.customer_city = c2.customer_city and c1.customer_id < c2.customer_id;

No 2 SS
(of Query &
Output
in Shell)
No 3 Query select branch_name,sum(balance * 0.04) as Total_interest from account group by branch_name;
(as Plain Text)

No 3 SS
(of Query &
Output
in Shell)

No 4 Query MariaDB [Bank_23101130]> select a.account_number, b.branch_city, a.balan


(as Plain Text) ce
-> from account a
-> join branch b ON a.branch_name = b.branch_name
-> where a.balance = (
-> select max(a2.balance)
-> from account a2
-> join branch b2 ON a2.branch_name = b2.branch_name
-> where b2.branch_city = b.branch_city
-> );
No 4 SS
(of Query &
Output
in Shell)

No 5 Query MariaDB [Bank_23101130]> select l.loan_number, l.amount, c.customer_name


(as Plain Text) -> from loan l
-> join borrower b on l.loan_number = b.loan_number
-> join customer c on b.customer_id = c.customer_id
-> order by l.amount asc, l.loan_number desc limit 5;

No 5 SS
(of Query &
Output
in Shell)

No 6 Query MariaDB [Bank_23101130]> select distinct c.customer_name


(as Plain Text) -> from customer c
-> join depositor d on c.customer_id = d.customer_id
-> join account a on d.account_number = a.account_number
-> join borrower b on c.customer_id = b.customer_id
-> join loan l on b.loan_number = l.loan_number
-> where a.branch_name = 'Perryridge' and l.branch_name = 'Perryridge';

No 6 SS
(of Query &
Output
in Shell)

No 7 Query MariaDB [Bank_23101130]> SELECT c.customer_name, COUNT(b.loan_number) AS


(as Plain Text) total_loan
-> FROM borrower b
-> JOIN customer c ON b.customer_id = c.customer_id
-> GROUP BY b.customer_id, c.customer_name
-> HAVING total_loan >= 2;

No 7 SS
(of Query &
Output
in Shell)

You might also like