课程: Programming Foundations: Databases
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Modifying data
- [Instructor] While we can query information from a database with SQL, we can also use SQL to modify data, retrieving data or reading it is the R in the CRUD acronym. Let's take a look at the others, create, update, and delete. Let's add a new customer to the database, to do that I'll use the insert keyword and tell the database where I want the data to go with into customers and then I'll provide the column names and the values to insert into them. I'll run that query and then when I ask for the contents of the customers table again, down here at the bottom of the table I can see my new customer was added. The database provided an auto incrementing key to give us a unique value for this customer. Any values we didn't provide are null and that's okay because of the way that we defined this table earlier. We only required that first name, last name, and phone need to not be null. If we left off one of those fields and…