SQL Tutorial menu

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

sql
SELECT name, city
FROM students
WHERE city = 'Karachi';
namecity
Ali KhanKarachi
Bilal AhmedKarachi
Hamza RazaKarachi

What You Will Learn

  • What a database, a table, a row and a column are
  • Reading data with SELECT, filtering with WHERE and sorting with ORDER BY
  • Adding, changing and removing data with INSERT, UPDATE and DELETE
  • Counting and totals with COUNT, SUM, AVG, MIN and MAX
  • Searching with LIKE, IN and BETWEEN
  • Combining tables with joins, and grouping rows with GROUP BY and HAVING
  • 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.

Learn SQL with a teacher

Join the Full Stack Development course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp