SQL Fundamentals

Most web applications rely on storing their data in a relational database, consisting of tables which are comprised of columns and rows. PostgreSQL, MySQL and SQLite are the most popular and established relational databases, and luckily, they have a LOT in common.

SQL Fundamentals

Creating, Updating and Deleting

Now that we have gotten used to the different ways to retrieve data from our database, we will learn how to create, manipulate and destroy records.

  • Creating, Updating and DeletingCreating and Deleting Records

    CREATE and DELETE are considerably simpler than the SELECT statement we have been working with so far. More often than not, you’ll be building these queries with values entered by users, so this is a great time to discuss SQL injection attacks and how we can defend against them.

  • Creating, Updating and DeletingEXERCISE: Creating and Updating Orders

    We’ll build the proper queries for creating new orders and updating existing ones, being sure to avoid susceptibility to SQL injection attacks.

  • Creating, Updating and DeletingTransactions

    Transactions allow a sequence of SQL statements to be grouped together and treated by the database as one "all or nothing" unit. This important tool allows us to achieve an even higher level of data consistency and integrity - through the assurance that the entire transaction will either complete, or the database will be left totally unaffected.

  • Creating, Updating and DeletingEXERCISE: Transactions

    We'll use a transaction to update our SQL statement for creating a new order.

  • Creating, Updating and DeletingWrap up and review

    We'll review everything we have covered so far, and set our sights on tomorrow's topics.