Blog

Learn SQL for students: two weeks from the first query to a data project

SQL sticks when you have a question you want your own data to answer.

The short answer

To learn SQL as a student, start with a small database on your own laptop rather than a textbook. Install SQLite, build two tables from your own course data, and spend week one on SELECT, WHERE and ORDER BY. Week two covers JOIN and GROUP BY. The plan ends with a small project answering three real questions.12

Learn SQL for students: two weeks from the first query to a data project

By the tiswa editorial team, from the official sources listed at the end of this guide. How we write our guides

You watch a video where the instructor types a long query against an employees table that means nothing to you, and you think you followed it. Two days later you sit in front of an empty screen with no idea how to begin. That gap is normal, because watching and typing are different skills. This plan flips the order: you type from day one, on data that belongs to you.

How do you start learning SQL as a student from zero?

Start with the lightest tool. SQLite keeps a whole database in a single file, and it ships with a command-line program called sqlite3 that opens the file and runs queries directly.1 It is often preinstalled on a Mac, and on Windows you download it from the official SQLite site. If you dislike the command line, a free tool such as DB Browser for SQLite gives you a windowed view of the same file. The language is identical either way.

Before you type anything, choose a subject. The best subject for a beginner is data you already understand: your courses, their assessments and your grades, or your monthly spending, or this week’s training timetable. Write the subject as one sentence, such as: which course takes most of my hours this semester? That sentence will steer every table you create.

What does a two-week SQL study plan look like?

  1. Day 1: install and open a database

    Create a file called study.db and a courses table with an id, a course name and credit hours. Insert five real courses with INSERT.

  2. Day 2: SELECT and WHERE

    Read every row, then only the columns you need, then only courses worth more than three credits. Type each query yourself; do not paste.2

  3. Day 3: ORDER BY and LIMIT

    Sort courses by credit hours and take the top two. Flip the order to descending and watch what changes.

  4. Day 4: a second table

    Create an assessments table with a quiz and an assignment per course, a course_id column pointing at the course, and columns for score and weight.

  5. Day 5: review without looking

    Rewrite the queries from days one to four from memory in a new file. What you forgot is what you revise.

  6. Days 6 and 7: rest and read

    Read the SELECT page in the SQLite documentation and stop at anything its examples show that you did not understand.2

  7. Days 8 and 9: JOIN

    Join courses to their assessments so each score appears beside its course name. Try INNER JOIN, then LEFT JOIN, and see which course has no assessment yet.

  8. Days 10 and 11: GROUP BY

    Calculate the average score and the number of assessments per course, then filter the grouped result with HAVING.

  9. Days 12 to 14: the project

    Answer three questions about your subject. Write one query for each, and one sentence explaining what the result means.

9 steps: What does a two-week SQL study plan look like (Day 1: install and open a database, Day 2: SELECT and WHERE, Day 3: ORDER BY and LIMIT, …)

What is the first SQL query to write?

Your first query should be small enough to watch it work. Once the courses table exists and has rows, type: SELECT name, credits FROM courses WHERE credits > 3 ORDER BY credits DESC; This is an illustration, not real data. Read it as a sentence: pick the name and credits from the courses table where credits are above three, largest first. If you can say the sentence, you understand the query.

When SQLite throws an error, do not panic. The message usually names the word where it stumbled, and the usual causes are a stray comma, a missing semicolon or a misspelt column name. Read the full message before you change anything, because random guessing burns time.

How do you practise joins and grouping without ready-made data?

Build the data yourself first. Twenty rows of your real or estimated grades are enough to practise JOIN and GROUP BY, and they beat a huge table whose origin you cannot explain. If an example row is invented, label it as an example in the table name so your results do not blur together later.

When you want bigger data, the Saudi Open Data Platform publishes datasets and you can download some of them as CSV.3 Check each dataset’s terms of use and licence before you publish anything built from it. After downloading, import the file into SQLite: set the mode with .mode csv, then load it with .import followed by the file name and a table name.1

QueryWhat it doesUse it when
SELECT … WHEREPicks the rows that meet a conditionYou ask: which rows matter to me?
ORDER BY … LIMITSorts results and keeps the first fewYou want the highest or lowest
JOINCombines two tables on a shared columnThe facts sit in two tables
GROUP BYTotals or averages per categoryYou ask: how many per course or month?
HAVINGFilters after groupingThe condition is on a calculated result
Table: How do you practise joins and grouping without ready-made data (SELECT … WHERE, ORDER BY … LIMIT, JOIN, …)

How do you turn what you learned into a small data project?

A project means three questions, three queries and a one-page explanation. With the courses subject, for example: which course has my lowest average score? Which assessment carries the biggest weight and is still undone? How many credit hours am I carrying this semester? Questions that size are enough, as long as you explain each result in a sentence instead of leaving a bare table.

Keep the project in one folder: the database file, a text file of queries and the explanation. That folder is what you show a supervisor or a co-op interviewer, and it carries more weight on a resume than the phrase “I know SQL”. If you want to grow from here, the data analysis roadmap shows the next step.

Should you learn SQL or Python first?

Learn SQL first if you study accounting, business, marketing or health information management, because you will open databases before you write programs. Learn Python first if your goal is AI or automation. If you want both, give SQL three weeks, since it has few words to learn, and then move on. For deeper coverage of the core queries read learn SQL from scratch.

The courses database you built here is useful elsewhere. If you track grades in a spreadsheet today, read the Excel course grade tracker and compare the two approaches, since each suits a different amount of data.

Questions

How long does it take to learn SQL as a beginner?

Two weeks at about an hour a day is enough to write filtering, joining and grouping queries. Fluency comes from projects, but the foundation is short.

Do I need to install anything to learn SQL?

Yes, but it is small. SQLite comes with a free command-line tool, and a free graphical alternative exists if you prefer windows.[^1]

What is the best free website to learn SQL?

Start with the official documentation, such as the SELECT page in SQLite and the SQL tutorial in the PostgreSQL docs, then practise on your own file.[^2][^4] The best site is the one where you type the query yourself.

Is SQL hard for a non-programming student?

No. It reads close to plain English and most work uses five core words. The real difficulty is designing tables, and that comes after you can read data comfortably.

What is the difference between SQLite and MySQL for a learner?

SQLite is a file on your laptop with no server, while MySQL is a server that needs setup. SQLite is enough for learning, and the basic queries look almost the same in both.

How do I import a CSV file into SQLite?

Open your database in sqlite3 and run .mode csv, then .import file_name table_name. Check with SELECT * FROM table_name LIMIT 5; that the columns loaded correctly.[^1]

Sources

  1. SQLite: Command Line Shell For SQLite: sqlite.org/cli.html
  2. SQLite: SELECT: sqlite.org/lang_select.html
  3. Saudi Open Data Platform: data.gov.sa
  4. PostgreSQL documentation: SQL tutorial: postgresql.org/docs/current/tutorial-sql.html

Hear when tiswa opens.

Join the free waitlist. We notify you at launch; then verify as a student and access the deals under their terms.

  • Free for good
  • No card
  • Takes a minute
Join the waitlist

More articles

Current prices for every offer are on Every student discount in Saudi Arabia, and each one opens in the tiswa app once you are verified as a student.