Updating records in sql
To add one record to a table, you must use the field list to define which fields to put the data in, and then you must supply the data itself in a value list. For example, the following statement will insert the values "1", "Kelly", and "Jill" into the Customer ID, Last Name, and First Name fields, respectively.To add many records to a table at one time, use the INSERT INTO statement along with a SELECT statement.
Nonetheless SQL Server allows it but doesn't guarantee a deterministic result. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
UPDATE summary_data SET current_category = (SELECT category_id FROM products WHERE products.product_id = summary_data.product_id) WHERE EXISTS (SELECT category_id FROM products WHERE products.product_id = summary_data.product_id); If you want to test your skills using the SQL UPDATE statement, try some of our practice exercises.