Problem StatementCreate a query to update the membercost column to 1000 in the facilities table where the value of monthlymaintenance is greater than 500.The column names and data types are given below.
Question
Problem StatementCreate a query to update the membercost column to 1000 in the facilities table where the value of monthlymaintenance is greater than 500.The column names and data types are given below.
Solution
Sure, based on your problem statement, it seems like you are working with SQL. Here is the query you would use to update the membercost column to 1000 in the facilities table where the value of monthlymaintenance is greater than 500:
UPDATE facilities
SET membercost = 1000
WHERE monthlymaintenance > 500;
This query works as follows:
UPDATE facilities: This tells SQL that you want to update thefacilitiestable.SET membercost = 1000: This sets themembercostcolumn to 1000 for all rows that meet the condition in the WHERE clause.WHERE monthlymaintenance > 500: This is the condition that must be met for the rows to be updated. Only rows wheremonthlymaintenanceis greater than 500 will have theirmembercostupdated to 1000.
Similar Questions
Create a query to update the membercost column to 1000 in the facilities table where the value of monthlymaintenance is greater than 500.
Given a table salary, such as the one below, that has m=male and f=femalevalues. Swap all f and m values (i.e., change all f values to m and vice versa)with a single update statement and no intermediate temp table.Note : You must write a single update statement, DO NOT write any selectstatement for this problem.Example:idnamesexsalary1Am25002Bf15003Cm55004Df500After running your update statement, the above salary table should have thefollowing rows:idnamesexsalary1Af25002Bm15003Cf55004Dm500Optionsupdate salaryset sex = if(sex = 'm', 'f', 'm');update salaryset sex = if(sex = 'm', 'm', 'm');update nameset salary = if(name = 'm', 'f', 'm');update salaryset sex = if(sex != 'f', 'm', 'm');
UPDATE `db_me`.`student_table` SET `student_name` = 'Sarah Geronimo' WHERE `student_table`.`student_id` =1;*5 pointsThere is an error in the statementStatement will execute successfullyOther:INSERT INTO `db_me`.`student_table` (`student_id` ,`student_name` ,`student_year`)VALUES (NULL , 'Sarah G', '3rd year'), (NULL , 'Moira', `3rd year`);*5 pointsThere is an error in the statementStatement will execute successfullyOther:CREATE DATABASE 'db_me' ; *5 pointsThere is an error in the statementStatement will execute successfullyOther:CREATE TABLE `db_me`.`student_table` (`student_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,student_name VARCHAR( 255 ) NOT NULL ,`student_year` VARCHAR( 255 ) NOT NULL) *5 pointsThere is an error in the statementStatement will execute successfullyOther:BackNext
Which of the below queries displays employees' name and new salary after the increment of 1000
Table building_type(Update)Write a query to change the name 'Pharmacy' to 'Hospital' in the building_type table.
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.