Code24Lab
Databases & SQL Beginner

MySQL Foundations: Databases, Tables, Keys & Basic Queries

Build and query a fictional coffee roaster's MySQL database: data types, CREATE TABLE, primary and foreign keys, AUTO_INCREMENT, INSERT/UPDATE/DELETE, SELECT with LIMIT, CONCAT, IFNULL, DATE_FORMAT, GROUP BY and joins, with every answer checked as you go.

21 lessons 21 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

In this beginner course you build and query the MySQL database of a fictional coffee roaster, one lab per lesson. You choose integer, DECIMAL, VARCHAR and date types and compute their ranges and sizes, read CREATE TABLE statements, and replay what primary keys, foreign keys, UNIQUE, DEFAULT and AUTO_INCREMENT do to real inserts. Then you work through INSERT, UPDATE, DELETE and TRUNCATE, SELECT with WHERE, ORDER BY and MySQL's LIMIT offset form, CONCAT, IFNULL and DATE_FORMAT, GROUP BY with HAVING, and joins. Every answer is checked as you go, the first lesson is free, and a final exam leads to your certificate.

Lessons

  1. MySQL Server, Databases and Your First SELECTLabFree
  2. Integer Types: Bytes, Ranges and UNSIGNEDLab Locked
  3. DECIMAL for Money: Precision, Scale and RoundingLab Locked
  4. CHAR and VARCHAR: Text Columns and Their SizeLab Locked
  5. DATE, DATETIME and TIMESTAMPLab Locked
  6. CREATE TABLE: Columns, Types and Row SizeLab Locked
  7. PRIMARY KEY: One Unique Id per RowLab Locked
  8. AUTO_INCREMENT: How MySQL Numbers New RowsLab Locked
  9. FOREIGN KEY: Linking Orders to CustomersLab Locked
  10. NOT NULL, DEFAULT and UNIQUELab Locked
  11. INSERT: Adding Rows, Multi-Row VALUES and INSERT … SELECTLab Locked
  12. SELECT with WHERE, IN, BETWEEN and LIKELab Locked
  13. ORDER BY and LIMIT: Top Lists and PagingLab Locked
  14. UPDATE: Rows Matched vs Rows ChangedLab Locked
  15. DELETE and TRUNCATE: Removing Rows SafelyLab Locked
  16. String Functions: CONCAT, LPAD, LENGTH vs CHAR_LENGTHLab Locked
  17. NULL in Calculations: IFNULL and COALESCELab Locked
  18. Date Functions: DATE_FORMAT, DAYOFWEEK and LAST_DAYLab Locked
  19. GROUP BY and HAVING: One Row per CategoryLab Locked
  20. JOIN and LEFT JOIN: Orders, Products and CustomersLab Locked
  21. Final Project: The March Sales ReportLab Locked