Knowee
Questions
Features
Study Tools

Table building_type(Update)Write a query to change the name 'Pharmacy' to 'Hospital' in the building_type table.

Question

Write a query to change the name 'Pharmacy' to 'Hospital' in the building_type table.

🧐 Not the exact question you are looking for?Go ask a question

Solution

Sure, here is the SQL query to update the name from 'Pharmacy' to 'Hospital' in the building_type table:

UPDATE building_type
SET name = 'Hospital'
WHERE name = 'Pharmacy';

Here is the step by step explanation:

  1. UPDATE building_type: This line is telling SQL that we want to update the table named building_type.

  2. SET name = 'Hospital': This line is telling SQL what the update needs to be. In this case, we want to change the name field to 'Hospital'.

  3. WHERE name = 'Pharmacy': This line is telling SQL where it should make this update. We only want to update the rows where the name is currently 'Pharmacy'.

This problem has been solved

Similar Questions

Write a query to change the owner_name  'Nicholas' to 'Alexander' present in the building table

Write a query to change the owner_name  'Nicholas' to 'Alexander' present in the building table.

Write a query to change the type of field 'owner_name' in the 'building' table to varchar(500).

Write a query to modify the datatype of the column departmentId from VARCHAR(30) to INT in the table 'department'.Refer to the existing table DLL given below:

Write an UPDATE statement on the customers table to SET the years_old column to 42 for any customer with a last_name of Hall.

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.