Articles
49 articles covering Node.js, JavaScript, backend development, and more.
Combining Query Results with UNION
Sometimes you need to combine the results of two or more separate queries into a single result set. **UNION** lets you stack the results of multiple SELECT statements on top Read more
Simplifying Queries with Views
Sometimes you write the same complex query over and over — like joining three tables, filtering by certain conditions, and calculating aggregates. **Views** let you save a query and treat Read more
Ensuring Data Consistency with Transactions
Sometimes you need to run multiple SQL statements together as one unit — either they all succeed, or they all fail. For example, transferring money from one bank account to Read more
Making Queries Faster with Indexes
When you have a small table with 100 rows, queries are fast. But when you have a table with 1 million rows, finding a specific row can be slow. **Indexes** Read more
Database Design - Normalization
When designing a database, you need to decide how to organize your data into tables. Should everything go in one giant table? Should you split it into many small tables? Read more
Modifying Tables with ALTER TABLE
When you first create a table, you define its structure — what columns it has, what types they are, etc. But requirements change. Maybe you need to add a new Read more
Working with Dates and Times
When building applications, you often need to work with dates and times — like storing when a user registered, finding posts from the last 7 days, or calculating someone's age. Read more
Working with Text - String Functions
When working with text data, you often need to manipulate strings — like converting to uppercase, extracting part of a string, or combining multiple strings together. SQL provides **string functions** Read more
Conditional Logic with CASE
Sometimes you want to show different values or messages depending on the data. For example, showing "Pass" if a score is above 60 and "Fail" if it's below. **CASE** statements Read more
Subqueries in SQL
A **subquery** is a query inside another query. It's like asking a question, but to answer it, you first need to ask a smaller question. Subqueries let you break complex Read more