From the course: MySQL Essential Training (2019)
Unlock this course with a free trial
Join today to access over 23,100 courses taught by industry experts.
Inserting data - MySQL Tutorial
From the course: MySQL Essential Training (2019)
Inserting data
- [Instructor] The insert into statement is used to add a row or rows to a table. For this lesson we'll use the scratch database here in my MYSQL workbench. I'm connected with my admin connection and I will use scratch like this. And I'll execute that and we're now using the scratch database. So if I select asterisk from customer we'll see the whole customer table here. And you can see it has three rows, Bill Smith, Mary Smith, Bob Smith. They're the Smiths. And so I can insert into customer and list the columns that I want to add data to, so name, address, city, state, zip, and then the values clause is where I list the actual data. So I can say, Fred Flinstone 123, let's put it in quotes, Cobblestone Way, and he's in Bedrock which, as we all know, is in California. I'm just kidding. I don't think it's in any state. Nor does it have a zip code but we're going to go ahead and give it one, 91234. And close the parentheses and put in a semicolon. And now when I execute this it will…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
A brief overview of SQL4m 39s
-
(Locked)
Database organization2m 58s
-
(Locked)
Selecting rows5m 32s
-
(Locked)
Selecting columns2m 26s
-
(Locked)
Counting rows2m 2s
-
(Locked)
Inserting data3m 14s
-
(Locked)
Updating data3m 56s
-
(Locked)
Deleting data4m 47s
-
(Locked)
Joining queries across tables4m 8s
-
(Locked)
Finding databases, tables, and columns1m 40s
-
-
-
-
-
-
-