What is a database?
A relational database stores data in tables. Each table represents one thing from the business: employees, customers, products. Each row is one record (one employee), and each column is one attribute (name, salary).
A primary key is a column whose value never repeats and identifies each row, such as emp_id. A foreign key points to the primary key of another table; that is how tables connect. For example, dept_id in employees tells you which department an employee belongs to.
The language we use to talk to a database is SQL. Database management systems (DBMS) such as MySQL, Oracle and SQL Server all understand SQL with small differences. In these lessons we work on a small company database with six tables; you can browse it in the editor.
SELECT * FROM departments;
The star * means “all columns”. Press “Try it” on any example to load it into the editor and run it.
USE company; then list tables with SHOW TABLES; and see a table's columns with DESCRIBE employees;