Skip to Main Content
Learn SQL using MySQL in One Day and Learn It Well
book

Learn SQL using MySQL in One Day and Learn It Well

by Jamie Chan
April 2024
Intermediate to advanced content levelIntermediate to advanced
127 pages
2h 29m
English
Packt Publishing
Content preview from Learn SQL using MySQL in One Day and Learn It Well

Chapter 4: Inserting, Updating and Deleting Data

 

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.

 

Inserting Data

 

To insert data into MySQL, we use the following syntax:

 

INSERT INTO table_name (column1, column2, column3, …)

VALUES (value1, value2, value3, …);

 

Image

 

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', ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Crash Course

MySQL Crash Course

Rick Silva

Publisher Resources

ISBN: 9781836205678Supplemental Content