Which SQL statement is used to add a new row to a database table?
Correct Answer: A. INSERT
The INSERT SQL statement is used to add a new row of data into a table within a database. It allows you to specify the table and the values for each column in the new row. This operation is essential for populating tables with data after the table structure has been created using CREATE. Without the INSERT command, you wouldn't be able to store new information in the database.
Why Other Options are Incorrect:
B. UPDATE:
The UPDATE statement modifies existing records in a table but does not add new ones. It is used when you want to change data in rows that already exist based on a specified condition, not to insert new rows.
C. CREATE:
The CREATE statement is used to define a new database object, such as a table or a database itself. It establishes the structure but does not deal with adding data to the table after its creation.
D. MODIFY:
MODIFY is not a standard SQL command for inserting data. In some SQL dialects, it may be used to alter column properties within a table, but it is not used to add new rows or manipulate data content directly.
Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.
You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams