Storing data in a database is pretty important. Find out how to do this with the INSERT keyword.
- [Instructor] To add 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.…Let's add a record to our People table…and add the first name Bob.…To do that, I'll write INSERT INTO people…and then in parentheses…the name of the field that I want to use,…in this case, first name.…
Then the VALUES keyword and again, in parentheses,…the information that I want to put into that field.…I'll run the statement and the database tells me…that my query was executed successfully…and that one row was affected.…That's what I'd expect.…I'm adding one record and so that would be one row.…Let's take a look at the table with SELECT *…FROM people.…
And down here at the bottom of the results,…there's record 1001, Bob.…The first-name field has what we added…and the rest of the fields have Null in them…
- Name the predicate of the following statement: SELECT EyeColor, Age FROM Student WHERE FirstName = 'Tim' ORDER BY LastName ASC;
- Explain what to use to enforce the order in which an expression must be evaluated if the WHERE clause contains multiple expressions to evaluate.
- Identify the best option to join two tables in a database to be able to display data from both.
- List a data type that is not numeric.
- Determine the result of running the following statement on a table containing columns col_1 and col_2:
- INSERT INTO Box (col_1, col_2) VALUES ('A', 'B'), ('A', 'B'), ('A', 'B'), ('A', 'B');
- Determine the best approach of deleting Jon Ramirez (ID 3452) from a Student table.