Using SQL to update a database
SELECT * FROM diary_logs WHERE food LIKE "%ice cream%" AND activity LIKE "%running%";
SELECT- it's all read only. We're not creating any new data, we are just querying existing data. We need to get very good at
SELECTqueries, but we don't need to know how to create tables, update rows, and all of that.
INSERT INTO diary_logs (id, food, activity) VALUES (123, "ice cream", "running");
diary_logs.insert().values(id=123, food="ice cream", activity='running')
INSERTis relatively safe, because all it does is add data, but operations like
ALTERcan be much more dangerous, because they are updating existing data. That's why it's important to really understand those well, and use them carefully. Keep going to learn how to use them!