shubh.
Links Creative Portfolio
← Back to blogs

From Scratch To SQL

From Scratch to SQL: A No-BS Map of Computer Science

Why This Exists

CS sounds scary because of the words, not the ideas. "Loop," "query," "Boolean logic" — every one of these is just a fancy name for something you already do daily. A loop is a routine. A query is a question. Boolean logic is just yes/no thinking.

This is the fast version — no fluff, just the ideas that matter, each with a real-life comparison so it actually sticks. Every topic ends with a link if you want to go deeper.

1. How a Computer Actually Works

Start here — this is the machine everything else runs on.

Binary — The Computer's Only Language

What: Computers only understand two states — 0 and 1. Every letter, image, and app is secretly a long string of these.

Analogy: A light switch — only "on" or "off," nothing in between. Millions of switches flipping fast enough gives you Instagram.

🔗 Binary Number System — GeeksforGeeks

Boolean Logic

What: True/False math, combined using logic gates.

Analogy: These three gates are the grammar rules binary uses to make decisions.

This is literally what's happening inside your processor, millions of times a second.

🔗 Boolean Algebra — GeeksforGeeks

RAM vs. Storage

What: RAM holds what your computer is actively using right now — fast, but wiped when powered off. Storage (SSD/HDD) holds everything permanently, even when off — slower, but doesn't forget.

Analogy: RAM is your desk — fast to grab things, but cleared at day's end. Storage is your cupboard — slower to reach, but stuff stays there.

App feels laggy? Probably low RAM. Running out of space for photos? That's storage.

CPU vs. GPU

What: The CPU is the general-purpose brain — handles one task at a time, very fast, very smart. The GPU handles thousands of simple tasks at once — built for graphics and, more recently, AI.

Analogy: CPU = one expert solving problems one by one. GPU = a thousand average workers solving a thousand simple problems simultaneously.

This is why AI training uses GPUs — it's mostly small repeated math, done in parallel.

Operating System

What: The software that manages everything else — apps, files, memory — and lets you actually interact with the hardware.

Analogy: The manager of a building. You never talk to the electricity or plumbing directly; the manager (OS) handles it and gives you a clean interface.

Windows, macOS, Linux, Android — all doing the same core job, different personalities.

🔗 Operating System Basics — GeeksforGeeks

2. Your Toolkit

Before you write real code, this is the setup you'll actually be using.

File Extensions

What: The letters after the dot in a filename — tells your computer (and you) what kind of file it is and how to open it.

Analogy: Like a food label. .py is a Python meal, .html is a web page, .exe is ready-to-eat.

Extension What it is
.py Python code
.js JavaScript code
.html / .css Webpage structure / style
.cpp / .java C++ / Java code
.json Data storage format (used everywhere in web apps)
.csv Spreadsheet-style data (rows & columns as plain text)
.sql Database queries/scripts
.md Markdown — plain text with light formatting (like this blog)
.exe A ready-to-run Windows program
.txt Plain, unformatted text

.py is the recipe, running it gives you the dish. Code files vs. data files vs. run-ready programs — know the difference.

🔗 File Extensions — Microsoft Support

IDE vs. Text Editor

What: A text editor just edits text (Notepad). An IDE (Integrated Development Environment) edits code and runs it, debugs it, and catches errors — all in one app.

Analogy: A text editor is a plain notebook. An IDE is a notebook that also grades your homework and tells you where you went wrong, instantly.

VS Code, PyCharm, IntelliJ — these are IDEs (or IDE-like editors). You'll live in one of these.

🔗 IDE — IBM

Compiler vs. Interpreter

What: Both turn your code into something the computer understands. A compiler translates the whole program at once, before running it. An interpreter translates line-by-line, while running it.

Analogy: Compiler = translating a whole book before handing it over. Interpreter = a live translator, speaking one sentence at a time as you go.

C++ is compiled. Python is interpreted. This is why Python feels more "instant" but C++ often runs faster.

🔗 Compiler vs Interpreter — GeeksforGeeks

The Command Line (Terminal)

What: A text-only way to talk to your computer — instead of clicking, you type commands.

Analogy: Ordering food by typing a message vs. pointing at a menu. Slower to learn, way faster once you know it.

Almost every real dev tool — Git, Python, servers — is run through here, not by clicking icons.

🔗 Command Line Basics — GeeksforGeeks

Git & GitHub

What: Git tracks every change you make to your code. GitHub is a website that hosts that code online so others can see, use, or contribute to it.

Analogy: Git = "Track Changes" in a Word doc, but for code, with a full time-machine to undo anything. GitHub = Google Drive for that tracked project, but built for teams.

Every job, every open-source project, every college group project runs on this. Learn git commit and git push early — it'll save you more than once.

🔗 Git & GitHub — GeeksforGeeks

Package Managers

What: Tools that install other people's pre-written code into your project instead of you writing it from scratch.

Analogy: Ordering a part online instead of manufacturing it yourself.

pip install (Python) and npm install (JavaScript) — you'll type these constantly.

🔗 pip — GeeksforGeeks · npm — GeeksforGeeks

Debugging

What: The process of finding and fixing what's broken in your code — using error messages and breakpoints (pause points) instead of guessing.

Analogy: A doctor using symptoms to diagnose, not randomly prescribing medicine.

Reading the error message carefully solves 80% of bugs. Most beginners skip this step.

Comments

What: Plain-English notes inside your code that the computer ignores but humans read.

Analogy: Sticky notes on a recipe explaining why you changed a step.

Six months later, you will forget why you wrote what you wrote. Comments save future-you.

3. Thinking Like a Programmer

Before real code, there's logic. This is where every programmer starts.

Scratch (Block-Based Coding)

What: Drag-and-drop blocks instead of typed code. You learn the logic without worrying about spelling mistakes.

Analogy: LEGO instructions, not a blueprint. Same result, way less friction.

Three core ideas hide inside it:

Every app ever built runs on these three things: repeat, decide, react.

🔗 Scratch — Scratch Foundation

Algorithms & Flowcharts

What: An algorithm = steps to solve a problem. A flowchart = that plan, drawn out.

Analogy: A recipe. Chop → cook → stir → done. You plan before you touch the pan.

Real engineers sketch flowcharts before writing code. Plan first, build second.

🔗 Algorithms · Flowcharts — IBM

Pseudocode

What: Writing your logic in plain English that looks like code but isn't tied to any language.

Analogy: A rough draft before the final essay.

Plain Text

IF number MOD 2 equals 0 PRINT "Even" ELSE PRINT "Odd"

Used in interviews and textbooks because anyone can read it — no language required.

🔗 Pseudocode — GeeksforGeeks

4. Real Programming

Python / C++ Basics

This is the vocabulary. Every program is just variables + operators.

🔗 Python — W3Schools

Control Structures

Same logic as Scratch — just typed, with strict rules now.

🔗 Loops — GeeksforGeeks

Functions

What: Reusable blocks of code you can call anytime instead of rewriting.

Analogy: A blender — press the button, don't rebuild it every smoothie.

🔗 Functions — W3Schools

Exception Handling

What: Code that catches errors instead of crashing the whole program.

Analogy: A circuit breaker — one fault trips it, the house doesn't burn down.

🔗 Exception Handling — GeeksforGeeks

Object-Oriented Programming (OOP)

What: Organizing code around objects — bundles of data and behavior — instead of loose functions.

Analogy: A class is a cookie cutter. Objects are the individual cookies — same shape, different toppings.

Python, Java, C++ — all lean heavily on OOP. It's how most real-world software is structured.

🔗 OOP — GeeksforGeeks

Recursion

What: A function that calls itself to solve a smaller version of the same problem, until it hits a stopping point.

Analogy: Two mirrors facing each other — the reflection keeps repeating itself, smaller each time, until it fades out.

🔗 Recursion — GeeksforGeeks

File Handling

What: Reading and saving data permanently, not just while the program runs.

Analogy: Whiteboard (temporary) vs. notebook (permanent).

🔗 File Handling — W3Schools

5. Data Structures & Big O

Data Structures

How you store data decides how fast your program runs. This is the core of CS.

🔗 Data Structures — GeeksforGeeks

Big O (Time Complexity)

What: A way to describe how slow or fast your code gets as the input grows — without needing an exact stopwatch.

Analogy: Searching for a name in a phonebook one page at a time (slow) vs. jumping straight to the right letter (fast). Big O describes which strategy you're using.

O(1) = instant, O(n) = grows with input, O(n²) = grows painfully fast. Interviewers love asking this.

🔗 Big O Notation — GeeksforGeeks

6. Databases & SQL

Databases

What: Data stored in tables — rows (entries) and columns (categories) — instead of scattered files.

Analogy: A class attendance register. Each row = one student. Each column = one detail about them.

Instagram, Amazon, your college portal — all run on databases behind the scenes.

🔗 Databases — GeeksforGeeks

SQL

What: The language for talking to databases.

Nearly every company on Earth uses SQL to manage data. Learn this, it's job-ready.

🔗 SQL — W3Schools

7. Building the Web

HTML — The Skeleton

What: Structures a page using tags — headings, paragraphs, images, links.

Analogy: A skeleton. Holds everything together, no style, no color.

🔗 HTML — W3Schools

CSS — The Outfit

What: Controls how HTML looks — color, spacing, fonts, layout.

Analogy: Clothes on the skeleton. Same body, different vibe.

🔗 CSS — W3Schools

JavaScript — The Muscles

What: Makes pages react — clicks, pop-ups, live updates.

Analogy: The nervous system. Without it, a page just sits there.

HTML + CSS + JS = structure + style + behavior. That's every website you've ever used.

🔗 JavaScript — W3Schools

8. The Internet, Behind the Curtain

Client-Server Model

What: The client is your device asking for something (like opening Instagram). The server is a remote computer that has the data and sends it back.

Analogy: A restaurant. You (client) place an order; the kitchen (server) makes it and sends it out. You never see the kitchen — you just get the result.

This is literally what happens every time you open a website or app — a request goes out, a server answers.

🔗 Client-Server Model — GeeksforGeeks

HTTP/HTTPS & Status Codes

What: The "language" browsers and servers use to talk. HTTPS is the secure version. Status codes are short replies telling you what happened.

Analogy: Ordering food and getting a receipt code back: 200 = order confirmed, 404 = item doesn't exist, 500 = kitchen's on fire.

🔗 HTTP Status Codes — MDN Web Docs

DNS

What: Turns a website name (google.com) into the actual numeric address (IP) computers use to find it.

Analogy: A phonebook — you know the name, DNS finds the number.

🔗 DNS — MDN Web Docs

Cookies & Sessions

What: Small bits of data a website stores in your browser so it "remembers" you — like staying logged in.

Analogy: A wristband at a festival — proof you already paid, so you don't show ID at every stall.

🔗 Cookies — MDN Web Docs

Localhost & Ports

What: localhost means "this computer, right now" — used to test your own project before it goes live. A port is a specific "door" a program listens on (like :3000).

Analogy: Localhost is testing a recipe in your own kitchen before serving customers. A port is a specific counter number in a shared building — same address, different service.

APIs

What: A set way for two programs to talk to each other and exchange data.

Analogy: A waiter. You (the app) don't walk into the kitchen (another company's server) yourself — you tell the waiter (API) what you want, and it brings back the response.

Weather apps, payment gateways, login-with-Google — all of it runs on APIs talking to other companies' servers.

🔗 APIs — GeeksforGeeks

9. What Is a "Tech Stack"?

What: The full combo of tools used to build one app — not just one language, but everything working together.

Analogy: Building a house needs bricks and wiring and plumbing. A tech stack is the whole toolkit, not one tool.

Three layers:

What's a framework? Pre-built code that handles the boring, repetitive stuff for you.

Analogy: Flat-pack furniture vs. cutting your own wood. Same result, way less effort.

Example — MERN stack: MongoDB + Express + React + Node.js. One language (JavaScript), the entire app — frontend to database.

Every topic in this blog is a piece of a stack. Real apps are built by combining them.

🔗 Tech Stack — Coursera

10. AI, Since You'll Be Using It Anyway

Machine Learning

What: Instead of manually coding every rule, you feed a program lots of examples, and it learns the pattern itself.

Analogy: Teaching a kid to recognize dogs by showing thousands of dog photos, not by describing "four legs, fur, tail" in a rulebook.

Netflix recommendations, spam filters, Google Photos face-grouping — all pattern-finding, not magic.

What Is an LLM?

What: A Large Language Model (like the one you're reading this from) is trained on massive amounts of text to predict what word comes next — and that turns out to be enough to hold conversations, write code, and explain concepts.

Analogy: A very well-read friend who's read almost everything and can guess, with startling accuracy, what should come next in any sentence.

Tools like Claude and ChatGPT are now part of a fresher's actual toolkit — for debugging, learning, and writing faster. Learn to use them well, not just copy-paste from them.

The Big Picture

The machine (binary, hardware) → your tools (Git, IDE, terminal) → how to think (logic, algorithms) → real code (Python, functions, OOP) → organizing data efficiently (data structures, Big O) → storing it (databases, SQL) → showing it (HTML, CSS, JS) → connecting it to the world (networking, APIs) → the full stack that ties it together → and the AI tools you'll use every day from here on.

Nothing here is separate. A variable becomes a function, a function pulls from a database, a database feeds a frontend, an API connects it to the outside world, and underneath all of it — binary and Boolean logic flipping switches on a chip. CS isn't a pile of topics. It's one story. Now you know it.

Enjoyed this write-up? Consider supporting my work!

Sponsor on GitHub Support on Ko-fi Pay via UPI
On desktop? Scan the QR instead
UPI QR code to pay Shubh Gupta shubhgupta194@oksbi