Category Archives: Без рубрики

Database.What is clustered index ?

📘 What is a Clustered Index? A clustered index is a special type of index that determines the physical order of rows in a table. In other words: the table’s data is stored in the order of the clustered index. … Continue reading →

Posted in Без рубрики | Comments Off on Database.What is clustered index ?

Datasource.What is the difference between clustered and non-clustered indexes?

🗃️ 1. Clustered Index A clustered index determines the physical order of rows in a table. ✅ There can be only one clustered index per table. ✅ The data is stored directly in the index. ✅ The table is the … Continue reading →

Posted in Без рубрики | Comments Off on Datasource.What is the difference between clustered and non-clustered indexes?

Database.How EXPLAIN shows B-tree vs. hash usage in query plans ?

EXPLAIN (or EXPLAIN ANALYZE) is a command that shows how the database plans to execute a query, including: Whether it uses an index What type of index How many rows it expects to scan The access type (index, range, ref, … Continue reading →

Posted in Без рубрики | Comments Off on Database.How EXPLAIN shows B-tree vs. hash usage in query plans ?

Database.I was sure that Composite Index (Multi-column) is b-tree

✅ Yes — a Composite Index is usually a B-tree index too. Let’s clarify: 📘 Composite Index vs. B-tree: B-tree is the data structure used to implement the index. Composite index refers to the fact that the index is built … Continue reading →

Posted in Без рубрики | Comments Off on Database.I was sure that Composite Index (Multi-column) is b-tree

Database.What types of indexes exist?

🧱 1. B-tree Index (Balanced Tree) 🔹 Most common index type (used by MySQL, PostgreSQL, Oracle, etc.) 🔹 Efficient for equality (=) and range queries (<, >, BETWEEN, etc.) ✅ Good for: 🪜 2. Composite Index (Multi-column) 🔹 Index on … Continue reading →

Posted in Без рубрики | Comments Off on Database.What types of indexes exist?

Database.What are “indexes”? What are they used for? What are their advantages and disadvantages?

An index is a special lookup data structure that a database uses to speed up the retrieval of rows based on certain column values. Think of an index like the index of a book — it helps you find content … Continue reading →

Posted in Без рубрики | Comments Off on Database.What are “indexes”? What are they used for? What are their advantages and disadvantages?

Database.If i define primary key as student_id, course_id, why i use only WHERE student_id = 1, for example, and how index of primary key works here ?

🧱 1. Understanding Composite Primary Key Index When you define: The database creates a composite index on (student_id, course_id) — this is a B-tree index in most databases. Order matters here: It’s indexed like:(student_id → course_id) That means: The index … Continue reading →

Posted in Без рубрики | Comments Off on Database.If i define primary key as student_id, course_id, why i use only WHERE student_id = 1, for example, and how index of primary key works here ?

Database.Give example of use of composite primary key

🎓 Example Scenario: Student Course Enrollment You want to track which students are enrolled in which courses, and each student can enroll in many courses, while each course has many students — a many-to-many relationship. You use a junction table … Continue reading →

Posted in Без рубрики | Comments Off on Database.Give example of use of composite primary key

Database.Is primary key always indexed ?

✅ Is a Primary Key Always Indexed? Yes — in all major relational database systems, a primary key is automatically indexed. 📌 Why? Because: The primary key must be unique. The database must be able to quickly check for duplicates. … Continue reading →

Posted in Без рубрики | Comments Off on Database.Is primary key always indexed ?

Database.What are the types of relationships in a database? Give examples.

In relational databases, relationships define how data in one table is connected to data in another. There are three main types of relationships: 1. 🔁 One-to-One (1:1) ➡️ One record in Table A is related to only one record in … Continue reading →

Posted in Без рубрики | Comments Off on Database.What are the types of relationships in a database? Give examples.