GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — SQL UPDATE Statement - GeeksforGeeks SQL UPDATE StatementLast Updated : 29 Aug, 2026 The SQL UPDATE statement is used to modify existing data in a table by changing the values of one or more columns.
SyntaxUPDATE table_name
WorkingConsider the customer table shown below, which contains each customer’s unique ID, name, last name, phone number and country. This table will be used to demonstrate how the SQL UPDATE statement works. ![]() Example 1: Update Single ColumnWe have a customer table and we want to update the Age to 25 for the customer whose customer_name is 'Isabella'. Query: UPDATE customer SELECT * FROM customer;Output: ![]()
Example 2: Updating Multiple ColumnsWe need to update both the customer_name and country for a specific customer_id. Query: UPDATE customer Output: ![]()
Example 3: Omitting WHERE Clause in UPDATE StatementIf we accidentally omit the WHERE clause, all the rows in the table will be updated, which is a common mistake. Let’s update the customer_namefor every record in the table: Query: UPDATE customer SELECT * FROM customer;Output: ![]()
Comment ExploreData Constraints & Aggregate Functions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |