Free early access: every mock and report free with an account.

Database basics

A database is an organised collection of related data. A DBMS (Database Management System) is the software that stores, retrieves, updates and protects that data (e.g., MySQL, Oracle, MS Access). Compared with keeping separate files, a DBMS reduces redundancy (repeated data), keeps data consistent, and controls access.

Relational model (proposed by E. F. Codd): data is stored in tables (relations).

  • Row = record or tuple; column = field or attribute.
  • Degree = number of columns; cardinality = number of rows.
  • Primary key: uniquely identifies each row; it cannot be empty (NULL) or repeated.
  • Candidate key: any column(s) that could serve as the primary key; the ones not chosen are alternate keys.
  • Foreign key: a column that refers to the primary key of another table, linking the two.

SQL command groups: DDL — CREATE, ALTER, DROP (structure); DML — INSERT, UPDATE, DELETE (data), with SELECT for queries (sometimes listed separately as DQL); DCL — GRANT, REVOKE (permissions); TCL — COMMIT, ROLLBACK (transactions).

Worked example: Table Students(RollNo, Name, Class) has 3 columns and 40 rows, so degree = 3, cardinality = 40. RollNo is the natural primary key. To list names of Class 8 students: SELECT Name FROM Students WHERE Class = 8;

Other terms: normalisation splits tables to remove redundancy; transactions follow ACID — Atomicity, Consistency, Isolation, Durability.

Common confusions: DELETE removes rows (DML) while DROP removes the whole table (DDL); a foreign key may repeat, a primary key may not; degree counts columns, cardinality counts rows.

Fact sheet

  • Row = tuple/record; column = attribute/field.
  • Degree = columns; cardinality = rows.
  • Primary key: unique, not NULL.
  • Foreign key refers to another table's primary key.
  • DDL: CREATE, ALTER, DROP; DML: INSERT, UPDATE, DELETE; DCL: GRANT, REVOKE; TCL: COMMIT, ROLLBACK.
  • Relational model — E. F. Codd.
  • ACID: Atomicity, Consistency, Isolation, Durability.

Flashcards 7

1 / 7

Log in to add these cards to a daily review that brings them back after 1, 3, 7, 14 and 30 days.

Practise this topic: free 10-question quiz

Quiz from: IBPS RRB Officer Scale-I (PO): Main

Other exams (2)
Next topicBanking and financial awareness