A manager at a retail company needs to adjust the price of an item in their inventory database due to a recent change in supplier costs. Using appropriate commands, how would they modify the existing price for this item without affecting any other records in the database?
You selected this option
By using a SELECT statement with the new price where the item ID matches the specific product.
You selected this option
By deleting the item and adding it again with the new price.
You selected this option
By using an UPDATE statement to change the item's price where the item ID matches the specific product.
You selected this option
By using an INSERT statement with the new price for the item ID.
The correct answer is 'By using an UPDATE statement to change the item's price where the item ID matches the specific product.' This is because the UPDATE statement is used to modify existing data within a database. It can be targeted to change specific records by using a condition, usually through the WHERE clause, which ensures that only the intended records are updated. 'By using an INSERT statement with the new price' is incorrect because the INSERT statement adds a new record to the database, rather than modifying an existing one. 'By using a SELECT statement with the new price' is incorrect because SELECT is used to retrieve data from the database, not to update it. 'By deleting the item and adding it again with the new price' is not efficient and can lead to data integrity issues, especially if the item has relationships with other data in the database.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an UPDATE statement in SQL?
Open an interactive chat with Bash
What is the purpose of the WHERE clause in an UPDATE statement?
Open an interactive chat with Bash
Why shouldn't you use an INSERT statement to update existing records?