π What is SQL?
- SQL (Structured Query Language) is used to retrieve, update, and manage data in a database.
- Essential for data analysts, data scientists, business analysts, and developers.
- SQL is easy to learn and widely used.
π Databases & Database Management Systems (DBMS)
- A database consists of tables storing structured data (rows & columns).
- PostgreSQL is a powerful and popular open-source DBMS.
- pgAdmin is a GUI for PostgreSQL to help interact with the database.
π SQL Commands Learned Today
1οΈβ£ SELECT → Retrieve specific columns from a table.
SELECT column_name FROM table_name;
2οΈβ£ ORDER BY → Sort results in ascending (ASC) or descending (DESC) order.
SELECT column_name FROM table_name ORDER BY column_name DESC;
3οΈβ£ DISTINCT → Remove duplicates from results.
SELECT DISTINCT column_name FROM table_name;
4οΈβ£ LIMIT → Restrict the number of rows returned.
SELECT column_name FROM table_name LIMIT 10;
5οΈβ£ COUNT → Count the number of rows.
SELECT COUNT(*) FROM table_name; -- Total rows
SELECT COUNT(column_name) FROM table_name; -- Non-null values
SELECT COUNT(DISTINCT column_name) FROM table_name; -- Unique values
π Key Takeaways
β
SQL helps us efficiently retrieve and analyze data.
β
PostgreSQL + pgAdmin is a great setup for learning SQL.
β
Sorting, filtering, and counting data are foundational SQL skills.
β
We now have a strong base for more advanced topics.
Excited for tomorrow’s lessons? π Keep practicing these concepts, and let me know if you need any clarifications! π