Unit summary

A database is an organised collection of related data and a DBMS manages it, replacing file systems that suffer from redundancy and inconsistency. Data models (hierarchical, network, relational, object-oriented) describe structure. Keys identify rows (super, candidate, primary, alternate, foreign, composite, surrogate) and constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, CHECK) protect data. The ER model draws entities, attributes and relationships with cardinality; weak entities depend on owners. An ER diagram becomes tables: entities to tables, 1:N by a foreign key, M:N by a new table.

Glossary

Term Meaning
Database Organised collection of related data
DBMS Software that manages a database
Redundancy Unwanted repetition of data
Candidate key A minimal set of columns that identifies a row
Primary key The chosen candidate key; unique and not NULL
Foreign key A column that refers to a primary key of another table
Entity An identifiable real-world object
Cardinality How many entities take part in a relationship
Weak entity An entity without its own key, depending on an owner
Schema The structure of a table or database

Question bank

Short answer questions

  1. Define DBMS and list its advantages.
  2. Name four attribute types in the ER model.
  3. Differentiate candidate key and primary key.
  4. What is referential integrity?
  5. What is a weak entity set?

Long answer questions

  1. Differentiate file system and DBMS with a table.
  2. Explain the types of data models.
  3. Explain all keys with an example.
  4. Draw an ER diagram for a library and convert it to tables.
  5. Explain extended ER features.

Sources

  • Official BCA syllabus Database Management Systems, course code CC202, Unit I