From the course: Learning SQL Programming

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add data to a table

Add data to a table - SQL Tutorial

From the course: Learning SQL Programming

Start my 1-month free trial

Add data to a table

- [Narrator] To add new data to a database table, we can use the insert keyword. To add information, we need to tell the database a few important things. So the insert clause has a few components in addition to just insert. We need to tell it what table to add data to, what field or fields to add information in, and then the values to put in those fields. All right, insert into people. First name, values, Bob. That ran successfully, and let's take a look at the result with select star from people. Here, all the way down at the bottom is our new information. The first name field is what we added, and the rest of the fields have null in them. Because we didn't set any information, so they have no value stored in them. Let's write another insert statement to add some more information. I'll write insert into people, first name, last name, state code, city, shirt or hat. Values, Mary, Hamilton, OR, Portland and hat. I'll run that. And let's take a look at the table now with select star…

Contents