In this lession we will:
✶ Create a Table
✶ Insert Data into the Table
✶ Select Data from the Table
✶ Update Data from the Table
Next, we will insert a row of data into our user_table.
insert into user_table (username,email,password)
values ('candy_cane','codingcommanders@gmail.com','cupcake');
➼ insert -
We are going to insert data!
➼ user_table -
This is the name of the table we are putting data into.
➼ coloumn names -
Names of the columns that we are inserting values into.
➼ values -
Corresponding data values for the columns named.
I am going to insert 1 more row of data:
insert into user_table (username,email,password)
values ('bradley','brad@gmail.com','love');
Bradley has decided 'love' is not a good password. He wants to change it to 'Hjjs&&*j$js!'
update user_table
set password = 'Hjjs&&*j$js!'
where
user_id = 2;
Now I am going to select all the data in user_table:
SELECT * FROM user_table;
Now, I want to select the data row with a username of 'bradley'
SELECT * FROM user_table WHERE username='bradley';