Sobes.tech
Junior

What are relational databases made of?

sobes.tech AI

Answer from AI

Relational databases consist of the following main elements:

  1. Tables (Relations): The primary components for storing data. Each table is a set of rows (tuples) and columns (attributes).
  2. Rows (Records / Tuples): A single entry in a table containing data about one instance of an entity.
  3. Columns (Fields / Attributes): Represent a specific data type or characteristic of the entity described by the table. Each column has a name and a data type.
  4. Keys: Used to establish relationships between tables and ensure data integrity. Main types of keys:
    • Primary Key: Uniquely identifies each row in a table. Cannot be NULL.
    • Foreign Key: A reference to the primary key of another table, establishing a relationship between them. Can be NULL if not specified otherwise.
    • Unique Key: Ensures the uniqueness of values in a column or a group of columns, but can contain one NULL value.
  5. Indexes: Structures that allow faster search and sorting of data in tables.
  6. Relationships: Links between tables established using foreign keys. Types of relationships:
    • "one-to-one"
    • "one-to-many"
    • "many-to-many"
  7. Integrity Constraints: Rules that ensure the accuracy and consistency of data. Examples: NOT NULL, UNIQUE, CHECK, PRIMARY KEY, FOREIGN KEY.
  8. Schemas: Logical structure of the database describing tables, columns, data types, constraints, and relationships.
  9. Views: Virtual tables based on the result of an SQL query. They do not store data physically but represent a specific set of data from one or more tables.
  10. Triggers: Procedures that automatically execute in response to certain events (e.g., INSERT, UPDATE, DELETE) in a table.
  11. Stored Procedures: Sets of SQL operators that are compiled and stored in the database. They execute as a single unit.
What are relational databases made of? — QA / QA… - sobes.tech