What is an ER diagram?
An entity-relationship diagram shows entities, attributes, and relationships with cardinality and optionality.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 3217–3228 of 3610 questions
An entity-relationship diagram shows entities, attributes, and relationships with cardinality and optionality.
Cardinality describes how many records can relate, such as one-to-one, one-to-many, or many-to-many.
A one-to-one relationship can be implemented with a foreign key constrained to be unique, or by sharing the same primary key between related tables.
Place the foreign key on the many side. Each child row references one parent, and one parent can be referenced by multiple children.
Create a junction table containing foreign keys to both related tables. Add a composite or surrogate primary key and constraints to prevent invalid duplica
A junction or bridge table resolves a many-to-many relationship and may store attributes of the association itself.
A schema is a namespace or logical container for database objects; exact behavior differs by database engine.
An index is a data structure that can help locate rows without scanning the entire table, at the cost of storage and write overhead.
In SQL Server, a clustered index defines how table rows are organized at the leaf level of the index; a table can have only one clustered index. Other engi
In SQL Server, a nonclustered index is a separate index structure that points to table rows or clustered keys. Other engines have their own index implement
A composite index contains multiple key columns. Column order matters because the leading columns influence which predicates and ordering can use the index
A covering index contains the key and included/available columns needed by a query, allowing the database to satisfy it from the index without fetching add