Railways Exam  >  Railways Questions  >   To modify existing rows of the table _______... Start Learning for Free
To modify existing rows of the table _______ statement is used.
  • a)
    ALTER
  • b)
    MODIFY
  • c)
    UPDATE
  • d)
    COMMIT
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
To modify existing rows of the table _______ statement is used.a)ALTE...
  • SQL UPDATE is the command used to update existing table rows with new data values.
  • SQL ALTER table command is used to modify the definition (structure) of a table by modifying the definition of its column.
  • The SQL COMMIT command is the transactional command used to save changes invoked by a transaction to the database.
  • The SQL DELETE command is used to delete rows from a table.
Option 2 is invalid. There is no such MODIFY command in SQL.
View all questions of this test
Most Upvoted Answer
To modify existing rows of the table _______ statement is used.a)ALTE...
Explanation:

To modify existing rows of a table, the UPDATE statement is used in SQL.

UPDATE Statement:
The UPDATE statement in SQL is used to modify the existing records in a table. It allows you to change the values of one or more columns in a table based on specified conditions.

Syntax:
The basic syntax for the UPDATE statement is as follows:
```
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
```
- table_name: specifies the name of the table where the records are to be updated.
- column1, column2, ...: specifies the columns to be updated.
- value1, value2, ...: specifies the new values to be assigned to the columns.
- WHERE: specifies the conditions that must be met for the update to be applied. If the WHERE clause is omitted, all rows in the table will be updated.

Example:
Let's say we have a table named "employees" with the following structure:
```
+----+----------+-----------+
| ID | Name | Salary |
+----+----------+-----------+
| 1 | John | 5000 |
| 2 | Mary | 6000 |
| 3 | Steven | 4500 |
+----+----------+-----------+
```

Now, if we want to update the salary of employee with ID 2 to 7000, we can use the following UPDATE statement:
```
UPDATE employees
SET Salary = 7000
WHERE ID = 2;
```

After executing the above statement, the table will be modified as follows:
```
+----+----------+-----------+
| ID | Name | Salary |
+----+----------+-----------+
| 1 | John | 5000 |
| 2 | Mary | 7000 |
| 3 | Steven | 4500 |
+----+----------+-----------+
```

In this example, the UPDATE statement is used to modify the salary column of the employees table for the row with ID 2. The SET clause specifies the new value for the Salary column, and the WHERE clause specifies the condition that must be met (ID = 2) for the update to be applied.

Therefore, the correct option is c) UPDATE as it is used to modify existing rows of a table in SQL.
Explore Courses for Railways exam
To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer?
Question Description
To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? for Railways 2024 is part of Railways preparation. The Question and answers have been prepared according to the Railways exam syllabus. Information about To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? covers all topics & solutions for Railways 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer?.
Solutions for To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Railways. Download more important topics, notes, lectures and mock test series for Railways Exam by signing up for free.
Here you can find the meaning of To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice To modify existing rows of the table _______ statement is used.a)ALTERb)MODIFYc)UPDATEd)COMMITCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Railways tests.
Explore Courses for Railways exam

Top Courses for Railways

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev