SQL Concepts Flashcards
(137 cards)
What is a Database?
A structured collection of data, organized for efficient storage, retrieval, and management.
What is SQL?
Stands for Structured Query Language; it’s a standard language for interacting with and managing databases.
Difference between DBMS and RDBMS?
DBMS manages databases; RDBMS is a type of DBMS that stores data in related tables.
What are Constraints in SQL?
Rules enforced on data columns in a table to ensure data accuracy and reliability.
What is Data Integrity?
The overall accuracy, completeness, and consistency of data.
What is NULL in SQL?
Represents a missing or unknown value in a database field.
What is Data Redundancy?
Storing the same piece of data multiple times within a database.
What is a Primary Key?
A constraint that uniquely identifies each record in a table.
What is a Foreign Key?
A field in one table that refers to the Primary Key in another table.
What is Referential Integrity?
Ensures that relationships between tables remain consistent.
What is an ERD (Entity-Relationship Diagram)?
A visual representation of the structure of a database.
What are the main components of an ERD?
Entities, Attributes, and Relationships.
What is an Entity in ERD?
A real-world object or concept about which data is stored.
Difference between Strong and Weak Entity?
A Strong Entity has its own primary key; a Weak Entity depends on a strong entity.
What is an Attribute in ERD?
A property or characteristic of an entity.
What is a Relationship in ERD?
An association between two or more entities.
What are Cardinality Symbols in ERD?
Symbols that define the numerical relationship between entities.
Difference between Cardinality and Ordinality?
Cardinality specifies the maximum number of times; Ordinality specifies the minimum number of times.
What is Total vs. Partial Participation?
Total Participation means every instance must participate; Partial Participation means participation is optional.
Describe a One-to-One (1:1) Relationship.
One instance of Entity A can relate to only one instance of Entity B.
Describe a One-to-Many (1:M) / Many-to-One (M:1) Relationship.
One instance of Entity A can relate to many instances of Entity B.
Describe a Many-to-Many (M:N) Relationship.
One instance of Entity A can relate to many instances of Entity B, and vice-versa.
What is Generalization in ERD?
A bottom-up approach where common attributes of multiple entities are combined.
What is Specialization in ERD?
A top-down approach where a higher-level entity is broken down into more specific entities.