-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsqlquery7.sql
31 lines (28 loc) · 1.13 KB
/
sqlquery7.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Problem Statement:
All those bank branches which are in Delhi and Bangalore are shifted to Noida due to its increasing popularity so update the branch accordingly.
Information about the table:
Table Bank :
+----+-------+-----------+--------------+
| id | Name | branch | CustomerBase |
+----+-------+-----------+--------------+
| 1 | HCBC | Hyderabad | 100000 |
| 2 | GDFS | Bangalore | 150000 |
| 3 | ZCZCQ | Delhi | 250000 |
| 4 | PU | Bangalore | 28000 |
| 5 | DUCO | Delhi | 56000 |
| 6 | LOTAK | Mumbai | 170000 |
+----+-------+-----------+--------------+
Solution:
UPDATE Bank SET branch='Noida' WHERE branch IN ('Delhi','Bangalore');
SELECT * FROM Bank;
Output:
+----+-------+-----------+--------------+
| id | Name | branch | CustomerBase |
+----+-------+-----------+--------------+
| 1 | HCBC | Hyderabad | 100000 |
| 2 | GDFS | Noida | 150000 |
| 3 | ZCZCQ | Noida | 250000 |
| 4 | PU | Noida | 28000 |
| 5 | DUCO | Noida | 56000 |
| 6 | LOTAK | Mumbai | 170000 |
+----+-------+-----------+--------------+