UPDATE

Why Trust Techopedia

What Does UPDATE Mean?

The UPDATE statement is a Structured Query Language (SQL) statement used to change or update values in a table. It is usually suffixed with a WHERE clause to restrict the change to a set of values that meet a specific set of criteria.

Advertisements

Techopedia Explains UPDATE

The general syntax of an UPDATE statement is:

UPDATE table_name SET column1=value1, column2=value2 WHERE column=condition

For example, in the Customer_master table, if a change needs to be made to both Andrew Smith’s email address (to [email protected]) and his date of birth (to February 17, 1985), the syntax would be:

UPDATE customer_master SET email_addr=”[email protected]”, date_of_birth=”02.17.1985″ WHERE customer_name=”Andrew Smith”

Note the importance of the WHERE clause in acting as a restriction on which rows of data are to be changed. Without the WHERE clause, the statement will update the entire table, setting all customers’ email addresses to [email protected] and all customers’ dates of birth to February 17, 1985.

To update a table, a username must be granted the privilege to do so by the database administrator. Even while using an application, when data is changed (like Andrew Smith’s email address above), the application is really sending the equivalent UPDATE statement like the one above to execute on the database.

Advertisements

Related Terms

Margaret Rouse
Technology Specialist
Margaret Rouse
Technology Specialist

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.