VALUES
VALUES in SQL is a keyword used in the INSERT INTO statement to specify the data that should be inserted into a certain table's columns. Each value is provided in a list enclosed by parentheses and separated by commas, with multiple lists separated by commas to denote multiple rows of data to insert.
Example
Output
Explanation
The provided MySQL statement inserts a new row into the employees
table. The row’s values for firstname
, lastname
, and age
columns are ‘John’, ‘Doe’, and 30, respectively. The output indicates that the operation was successful, with one row being affected.
Example
Output
Explanation
The INSERT INTO
command adds a new row into the Employee
table with the specified values. In this case, the new employee John
with id
1 is added. The output message INSERT 0 1
indicates that one row is successfully inserted.
Example
Output
Explanation
In this example, a new table named ‘Customers’ is created first with five columns. Then, using the INSERT INTO statement together with the VALUES clause, one new row is added to the ‘Customers’ table. `
Example
Output
Explanation
The INSERT INTO
statement was used to add a new row in the “Employees” table. The specific data (1, 'John', 'Doe', 35)
was inserted into corresponding columns (ID, FirstName, LastName, Age)
. The output indicates that one row was successfully inserted into the table.