---
title: "SQL: increase balances by 100% and 50%"
subject: "Database Management System"
chapter: 3
key: "semester_6/database_management_system:sql-update-balance-rates"
source: https://www.bctengineer.com/q/semester_6/database_management_system/sql-update-balance-rates
site: BCT Engineering
---

# SQL: increase balances by 100% and 50%

Database Management System · Chapter 3: Relational Languages & Relational Model

- Asked in: year not given
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/database_management_system/sql-update-balance-rates
- Whole chapter: https://www.bctengineer.com/md/semester_6/database_management_system/chapter-3

## Question

Consider database schema:
Account (acc_no, branch_name, balance)
Branch (branch_name, branch_city, assets)
Customer (customer_name, customer_street, customer_city)
Loan (loan_no, branch_name, amount)
Depositor (customer_name, acc_no)
Borrower (customer_name, loan_no)
Increase all accounts with balance over 10000 by 100% and others by 50%.

## Short answer

Use a single UPDATE with CASE: WHEN balance > 10000 THEN balance * 2 ELSE balance * 1.5 END. Alternatively run the over-10000 update first, then the others.

## Answer

Increasing by 100% means new balance = balance × 2. Increasing by 50% means new balance = balance × 1.5.

**Method 1: two UPDATE statements (order matters)**

```sql
-- 1st: accounts with balance over 10000 get 100% increase
UPDATE Account
SET    balance = balance * 2
WHERE  balance > 10000;

-- 2nd: all other accounts get 50% increase
UPDATE Account
SET    balance = balance * 1.5
WHERE  balance <= 10000;
```

The order is important. If the 50% update ran first, an account such as 9000 would become 13500, which is now above 10000, and the second statement would wrongly double it again. Running the "over 10000" update first is safe: doubled accounts stay above 10000 and are not touched by the second statement.

**Method 2: one statement with CASE (best, no ordering problem)**

```sql
UPDATE Account
SET balance = CASE
                 WHEN balance > 10000 THEN balance * 2
                 ELSE balance * 1.5
              END;
```

A single `UPDATE` evaluates the `CASE` against the old value of each row, so each account is increased exactly once.

**Sample (tested):** 60000 → 120000, 70000 → 140000, 5000 → 7500, 9000 → 13500, 10000 → 15000 (10000 is not over 10000), 20000 → 40000.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does a 100% increase mean?
   A. balance * 1
   B. balance * 1.5
   C. balance * 2
   D. balance + 100
   Answer: C. 100% increase doubles. (Key point: Multiplier)

2. Why run the over-10000 update first?
   A. Otherwise 9000 becomes 13500 and would be doubled again
   B. It is faster
   C. SQL requires
   D. Others would be skipped
   Answer: A. Order avoids double updates. (Key point: Order matters)

3. Why is CASE best?
   A. It needs two statements
   B. It updates twice
   C. It evaluates the old value of each row in one statement
   D. It ignores WHERE
   Answer: C. Each row is increased once. (Key point: CASE)

4. What happens to 10000?
   A. It is not over 10000, so it becomes 15000
   B. 20000
   C. 10000
   D. 12000
   Answer: A. Condition is balance > 10000. (Key point: Boundary)

## Close variants set in other exams

- [SQL: number of accounts per branch](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-count-accounts-branch) — Database Management System, chapter 3

## Related in Database Management System

- [SQL: branch city with assets over 1000000](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-branch-assets-million) — Database Management System, chapter 3
- [SQL: customer, branch, account details](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-natural-join-details) — Database Management System, chapter 3
- [SQL: customer name and address](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-customer-name-address) — Database Management System, chapter 3
- [SQL: branches with avg balance over 50000](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-avg-balance-branch) — Database Management System, chapter 3
- [SQL: create tables for bank schema](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-create-tables-bank) — Database Management System, chapter 3
- [SQL: customers with account in Dharan](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Asql-customers-dharan-branch) — Database Management System, chapter 3
