R 73
R 73
C:\Users\LENOVO>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 60
Server version: 8.0.34 MySQL Community Server - GPL
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
2) Find all loan numbers for loans made at Camp Branch with loan amount > 12000.
mysql> Select loan_no FROM loan WHERE branch_name = 'Camp' AND amount > 1200;
+---------+
| loan_no |
+---------+
| ij90 |
+---------+
1 row in set (0.00 sec)
3) Find all customers who have a loan from bank. Find their names,loan_no and
loan amount.
4) List all customers in alphabetical order who have loan from Camp branch
6) Find all customers who have both account and loan at bank.
7) Find all customers who have account but no loan at the bank
mysql> Select cust_name FROM depositor WHERE cust_name NOT IN (SELECT cust_name
FROM borrower);
+-----------+
| cust_name |
+-----------+
| Shraddha |
+-----------+
1 row in set (0.00 sec)
10) Find name of Customer and city where customer name starts with Letter P.
12) Find the branches where average account balance > 12000
15) Delete all loans with loan amount between 1300 and 1500.
mysql> Delete FROM loan WHERE amount BETWEEN 1300 AND 1500;
Query OK, 0 rows affected (0.00 sec)