A database is an organized collection of data that is stored and accessed electronically.
A Database Management System (DBMS) is software that manages databases and provides an interface for users to interact with the data. Imagine a librarian who manages a library. The librarian helps you find and check out books, just like a DBMS helps you store, retrieve, and manage data in a database.
SQL (Structured Query Language) is a language used to communicate with and manage databases.
Tables are the basic building blocks of a database, where data is stored in rows and columns. Think of a table like a spreadsheet in Excel. Each row represents a different record (like a different contact), and each column represents a different attribute of the record (like phone number or email address).
A primary key is a unique identifier for a record in a table.
A foreign key is a field in one table that links to the primary key in another table, creating a relationship between the two tables. For instance, in a library system, the 'Books' table might have a foreign key linking to the 'Authors' table to show which author wrote each book.
Normalization is the process of organizing data to reduce redundancy and improve data integrity. Imagine you have a list of contacts with repeated information. Normalization would involve separating the repeated information into different tables, such as separating contact details from company information to avoid duplication.
The main types of relationships are one-to-one, one-to-many, and many-to-many.
An index is a data structure that improves the speed of data retrieval operations. It’s like having a table of contents in a book that helps you quickly locate specific chapters or sections without reading the entire book.
A view is a virtual table created by querying one or more tables.
A stored procedure is a set of SQL statements that can be executed as a single unit. It’s like having a pre-defined checklist that you can use to perform a specific task, such as processing a customer order, without having to manually execute each step.
A trigger is a set of instructions that are automatically executed in response to certain events on a table or view.
A transaction is a sequence of operations performed as a single logical unit of work.
ACID stands for Atomicity, Consistency, Isolation, and Durability. These properties ensure reliable database transactions.
Denormalization is the process of combining tables to improve read performance, often at the expense of introducing redundancy.
A database schema is the structure that defines how data is organized and related. It’s like a blueprint for a building, showing where each room (table) goes and how they are connected (relationships).
Data integrity refers to the accuracy and consistency of data throughout its lifecycle.
A join operation combines rows from two or more tables based on a related column.
A subquery is a query within another query.
A cluster index sorts the data rows in a table based on the index key.
A non-clustered index creates a separate structure from the table and holds pointers to the actual data.
SQL injection is a type of attack where malicious SQL code is inserted into a query to manipulate the database.
A data warehouse is a large store of data collected from various sources, optimized for analysis and reporting.
OLAP (Online Analytical Processing) is used for complex querying and analysis of data.
OLTP (Online Transaction Processing) is used for managing day-to-day operations with a focus on transaction speed and efficiency.
Sharding is a method of splitting a database into smaller, more manageable pieces called shards.
CAP theorem states that a distributed system can only achieve two out of three properties: Consistency, Availability, and Partition Tolerance.
NoSQL databases are non-relational databases designed for handling large volumes of data and various data types.
A document store is a type of NoSQL database that stores data in document formats, such as JSON or BSON.
A key-value store is a type of NoSQL database that stores data as key-value pairs.
A column-family store is a NoSQL database that stores data in columns rather than rows.
A materialized view stores the results of a query physically, which can speed up query performance.
Schema migration involves making changes to the database schema to evolve its structure over time.
A database replica is a copy of a database used for backup, load balancing, or failover.
Eventual consistency is a model where data changes are propagated to all nodes eventually, but not immediately.
Database caching involves storing frequently accessed data in memory to speed up access times.