Author Archives: Stanislav_Panteleev

Database.Beginner.What is a self-join?

What is a Self-Join in SQL? ✅ A self-join is when: A table is joined to itself. We treat the same table as if it were two different tables (using aliases). We match rows with other rows in the same … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.What is a self-join?

Database.Beginner.Why is CHAR Sometimes Faster Than VARCHAR?

It’s mostly about reading speed — but let’s break it down: Why is CHAR Sometimes Faster Than VARCHAR? Fixed Size = Simple Calculations CHAR(n) always stores exactly n characters. The database can easily calculate: “Where is the 10th record? Just … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.Why is CHAR Sometimes Faster Than VARCHAR?

Database.Beginner.What is the difference between CHAR and VARCHAR?

Difference Between CHAR and VARCHAR in SQL Feature CHAR(n) VARCHAR(n) Meaning Fixed-length string Variable-length string Storage Always exactly n characters Only stores the actual length used (up to n) Padding Pads with spaces if shorter than n No padding — … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.What is the difference between CHAR and VARCHAR?

Database.Beginner.How would you update all rows in a table to set a column value to a default?

You can use a simple UPDATE statement without a WHERE clause. General Syntax Without WHERE → it affects every row in the table. With WHERE → it affects only rows matching the condition. Example Imagine you have a Users table: … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.How would you update all rows in a table to set a column value to a default?

Database.Beginner.What are Aggregate Functions in SQL?

✅ Aggregate functions are special SQL functions that: Take multiple input values (from rows) and return a single value as a summary. They work on a set of rows — not just one row at a time. Used commonly with … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.What are Aggregate Functions in SQL?

Database.Beginner.Anomalies.SQL.Example

Perfect! Let’s do a real SQL example where we: Cause a Dirty Read at low isolation. Fix it by changing the isolation level. Step-by-Step Dirty Read Example Assume we have a simple Accounts table: We have: account_id balance 1 1000.00 … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.Anomalies.SQL.Example

Database.Beginner.Anomalies

What are Anomalies in Transactions? When multiple transactions run at the same time (concurrency), if the database isn’t careful, weird problems (called anomalies) can happen. 👉 Anomalies are unwanted behaviors like: Reading data that isn’t finished. Seeing inconsistent results. Losing … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.Anomalies

Database.Beginner.What is a transaction?

What is a Transaction in SQL? A transaction is a single unit of work that consists of one or more SQL statements, executed together as a group. The database treats a transaction as all or nothing: All statements succeed ➔ … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.What is a transaction?

Database.Beginner.Explain ACID properties in databases.

What are ACID Properties in Databases? ACID stands for: Letter Property Meaning A Atomicity All or nothing — a transaction is fully done or fully undone. C Consistency The database moves from one valid state to another. I Isolation Transactions … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.Explain ACID properties in databases.

Database.Beginner.How would you find records that exist in one table but not another?

1. Using LEFT JOIN … WHERE NULL This is the most classic and portable method. Example Find rows in TableA that don’t exist in TableB: LEFT JOIN returns all rows from TableA and matches from TableB. Where TableB.id is NULL, … Continue reading →

Posted in Без рубрики | Comments Off on Database.Beginner.How would you find records that exist in one table but not another?