Update Records Using Expressions in SQL
📖 Scenario: You are managing a small store's database. The store keeps track of products and their prices. Sometimes, the store wants to increase prices by a certain percentage or apply discounts.
🎯 Goal: Learn how to update records in a SQL table using expressions to change values based on existing data.
📋 What You'll Learn
Create a table called
products with columns id, name, and price.Insert specific product data into the
products table.Write an
UPDATE statement that increases prices by 10%.Write an
UPDATE statement that decreases prices by 5 for products costing more than 50.💡 Why This Matters
🌍 Real World
Stores and businesses often need to update prices or quantities in their databases based on rules or calculations.
💼 Career
Knowing how to write update queries with expressions is essential for database administrators and developers managing real data.
Progress0 / 4 steps