Single-Table SELECT Statements
Examples of SQL select statments from a single table:
SELECT * FROM CUSTOMERS;SELECT CustomerName FROM CUSTOMERS;SELECT CustomerName, City FROM CUSTOMERS;SELECT * FROM CUSTOMERS WHERE City = 'Chicago';SELECT * FROM CUSTOMERS ORDER BY CustomerName;
Insert, Update, and Delete Statements
The following SQL statements demonstrate how to modify data within a table:
INSERT INTO CUSTOMERS (CustomerName, City) VALUES ('Jimmy Chang', 'Chicago');UPDATE CUSTOMERS SET City = 'New York' WHERE CustomerName = 'Jimmy Chang';DELETE FROM CUSTOMERS WHERE CustomerName = 'Jimmy Chang';
Reflection
While completing this activity, I learned about how SQL commands are used to retrieve and use data in databases. I found it interesting because to me this is all very new and I have never used SQL before. However when learning more about it and seeing how it is used and how to actually write code for it I can tell it is vert essential for working with databased in any form. I am looking forward to learning more about it and how it can be used in the future