COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
UPDATE customerSET numberOfOrders = 100, discount = “Yes"WHERE customerID = 50The explanation of the above code is:
|
Use the table customer, and update only the record containing customerID = 50. Change the contents of the field numberOfOrders to 100 and discount to “Yes".
|
|
Use the table customer. Change the contents of the field numberOfOrders to 100 and discount = “Yes”
|
|
Use the table customer, and update only the record containing customerID = 100. Change the contents of the field numberOfOrders to 50 and discount = “Yes”
|
|
Use the table customer, and update only the record containing customerID = 50. Change the contents of the field numberOfOrders to 100.
|
Explanation:
Detailed explanation-1: -The UPDATE command in SQL is used to modify or change the existing records in a table. If we want to update a particular value, we use the WHERE clause along with the UPDATE clause. If you do not use the WHERE clause, all the rows will be affected.
Detailed explanation-2: -To use the UPDATE method, you first determine which table you need to update with UPDATE table name . After that, you write what kind of change you want to make to the record with the SET statement. Finally, you use a WHERE clause to select which records to change.
Detailed explanation-3: -You use update queries in Access databases to add, change, or delete the information in an existing record.
There is 1 question to complete.