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.
- AND → both must be true (license and fuel to drive)
- OR → either works (pay by cash or card)
- NOT → flips it (not raining → false if it is)
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.
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:
- Loops → repeat something (a washing machine's spin cycle)
- Conditionals → if X, then Y (if it rains, take an umbrella)
- Event listeners → wait, then react (a doorbell)
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.
4. Real Programming
Python / C++ Basics
- Variable → a labeled box (age = 18)
- Data type → what's inside the box: text (string), numbers (int), yes/no (boolean)
- Typecasting → converting formats, like $ to ₹ — value stays, format changes
- Operator → symbols that act on data (+, ==)
This is the vocabulary. Every program is just variables + operators.
Control Structures
- if-elif-else → decisions
- for loop → repeat a known number of times (10 push-ups)
- while loop → repeat until something changes (eat popcorn till bowl's empty)
Same logic as Scratch — just typed, with strict rules now.
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.
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.
- Class → the blueprint (e.g., "Car")
- Object → an actual instance (e.g., "my red Honda")
- Inheritance → a new class reusing an existing one's features (e.g., "ElectricCar" inherits from "Car")
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.
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.
File Handling
What: Reading and saving data permanently, not just while the program runs.
Analogy: Whiteboard (temporary) vs. notebook (permanent).
5. Data Structures & Big O
Data Structures
- List/Array → numbered lockers, grab any item directly
- Stack (LIFO) → plate stack — last one in, first one out
- Queue (FIFO) → checkout line — first one in, first one served
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.
SQL
What: The language for talking to databases.
- Primary Key → a unique ID per row (like your Aadhaar number)
- SELECT → get data
- INSERT → add data
- UPDATE → edit data
- JOIN → combine two tables
Nearly every company on Earth uses SQL to manage data. Learn this, it's job-ready.
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.
CSS — The Outfit
What: Controls how HTML looks — color, spacing, fonts, layout.
Analogy: Clothes on the skeleton. Same body, different vibe.
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.
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.
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.
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.
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:
- Frontend (what users see) → HTML, CSS, JS + frameworks like React, Angular, Vue
- Backend (server logic) → Python, Java, Node.js + frameworks like Django, Express, Spring Boot
- Database (data storage) → MySQL, PostgreSQL, MongoDB
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.
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!
On desktop? Scan the QR instead
shubhgupta194@oksbi