Update Multiple Columns in a Database Table
📖 Scenario: You manage a small bookstore database. You want to update the prices and stock quantities of some books after a new shipment arrives.
🎯 Goal: Learn how to update multiple columns in a SQL table using a single UPDATE statement.
📋 What You'll Learn
Create a table called
books with columns id, title, price, and stock.Insert three books with specific values into the
books table.Write an
UPDATE statement to change the price and stock of a specific book.Use a
WHERE clause to update only the intended book.💡 Why This Matters
🌍 Real World
Updating multiple columns in a database is common when managing inventories, user profiles, or any data that changes over time.
💼 Career
Database administrators and developers often write UPDATE queries to maintain accurate and current data in business applications.
Progress0 / 4 steps