April 2024
Intermediate to advanced
127 pages
2h 29m
English
In the previous two chapters, we learned to create, alter and drop our databases and tables. In this chapter, we’ll learn to insert data into our tables. We’ll also learn to update and delete data.
To insert data into MySQL, we use the following syntax:
INSERT INTO table_name (column1, column2, column3, …)
VALUES (value1, value2, value3, …);

Suppose we want to insert the information above into the employees table, we write
INSERT INTO employees (em_name, gender, contact_number, salary, years_in_company) VALUES
('James Lee', 'M', '516-514-6568', 3500, 11),
('Peter Pasternak', ...