SQL Tutorial
SQL is the standard language for storing, reading and changing data in a database.
Almost every app you use keeps its data in a database: a bank keeps accounts, a school keeps students and results, an online shop in Karachi keeps products, prices and orders. SQL is how programs (and people) ask those databases questions.
Why Learn SQL?
- It is used by every major database: MySQL, PostgreSQL, SQL Server, Oracle and SQLite
- It is one of the most asked-for skills in developer, data analyst and back-end jobs
- It is small and readable: a query often looks like a plain English sentence
- What you learn once works almost everywhere, with only small differences
One Database for the Whole Tutorial
Every lesson uses the same small database of an IT institute. It has a students table and a courses table, so you can follow each example and see exactly how the result was produced.
Example
SELECT name, city
FROM students
WHERE city = 'Karachi';| name | city |
|---|---|
| Ali Khan | Karachi |
| Bilal Ahmed | Karachi |
| Hamza Raza | Karachi |
What You Will Learn
- What a database, a table, a row and a column are
- Reading data with
SELECT, filtering withWHEREand sorting withORDER BY - Adding, changing and removing data with
INSERT,UPDATEandDELETE - Counting and totals with
COUNT,SUM,AVG,MINandMAX - Searching with
LIKE,INandBETWEEN - Combining tables with joins, and grouping rows with
GROUP BYandHAVING - Creating and changing tables, with constraints such as primary and foreign keys
Exercises and Quiz
Most lessons end with a short exercise, and the last lesson is a quiz on the whole tutorial.
Exercise
What does SQL stand for?
What to Learn After SQL
Once you know standard SQL, pick a real database system: MySQL is very common with PHP and WordPress sites, and PostgreSQL is popular for modern web apps. For a different, document-based style of database, try MongoDB.
Want to learn with a teacher? The Workownix Full Stack Web Development course teaches databases together with front-end and back-end development through real projects, online or at our institute in Orangi Town, Karachi.
