This note is based on the learning materials from Liao Xuefeng’s website and W3Schools.
It takes about half a day to quickly learn SQL.
Part One: Basic Concepts
What is SQL? SQL (Structured Query Language) is used to store and manage large amounts of data.
What is MySQL? MySQL is an open-source SQL database management system and search engine.
Key Concepts:
- Foreign Key: Used to establish a many-to-many relationship between tables.
- Primary Key: Used to uniquely identify records in a table (e.g., an ID, GUID, or auto-increment integer type; can also be a composite key).
SQL Relationships:
- One-to-One
- One-to-Many
- Many-to-One
- Many-to-Many
(Above points are referenced from Liao Xuefeng’s SQL Tutorial and GeeksforGeeks).
Part Two: MySQL
- Inner Join: Combines rows from two or more tables based on a related column.
- Left Join: Returns all rows from the left table and the matched rows from the right table.
- UNION: Combines the results of two or more SELECT statements.
Part Three:
Feel free to complete the third part with the relevant information you have.
Leave a Reply