UNIHIVE

Study Hub UNIPORT CSC 182

CSC 182 · Computer Applications

Databases and DBMS

Fields, records and files, what a DBMS does, its advantages over manual records, and the types of DBMS.

Our notes

2 min read

Data and information

  • Data: raw facts (23, "Okafor", "CSC").
  • Information: data processed to give meaning ("Okafor scored 23 in CSC 182").

The data hierarchy

LevelMeaningExample
FieldOne factSurname
RecordAll fields about one itemOne student's details
File or tableRecords of one kindAll students
DatabaseRelated tablesStudents, courses, results

What a database is

An organised collection of related data stored so it can be found, updated and shared easily.

What a DBMS is

A database management system is software that creates, stores, protects and retrieves data in a database. Examples: Microsoft Access, MySQL, Oracle, PostgreSQL, SQL Server, SQLite.

Functions of a DBMS

  1. Data definition: create tables, fields and their types.
  2. Data entry and update: add, change, delete records.
  3. Retrieval: queries that find data quickly.
  4. Reports: present data for printing.
  5. Security: passwords and user rights.
  6. Integrity: rules that stop wrong data (no score above 100).
  7. Backup and recovery.
  8. Concurrency: many users at once without clashing.

Manual records against a DBMS

Manual files (paper)DBMS
Slow to searchFast queries
The same data copied in many files (redundancy)Stored once, shared
Copies disagree (inconsistency)One version
Easily lost, burnt or eaten by termitesBackups
Hard to summariseReports in seconds
Anyone can read a filePasswords and access levels
Takes much spaceCompact storage

Worked example: redundancy

A faculty keeps a student's phone number in the admissions file, the hostel file and the exams file. The student changes number and tells only the hostel. Now two files are wrong. In a database the number is stored once in the Students table and every office reads the same value.

Disadvantages of a DBMS

  • Cost of software, hardware and trained staff.
  • Complexity.
  • A single failure can affect everyone, so backups are vital.

Types of DBMS (data models)

TypeStructureExample use
HierarchicalTree: one parent, many childrenEarly mainframe systems
NetworkRecords with many linksOlder large systems
RelationalTables linked by keysAccess, MySQL: most systems today
Object-orientedData stored as objectsEngineering and multimedia
NoSQL (document, key-value)Flexible recordsLarge web apps

Keys in a relational database

  • Primary key: a field that is unique for each record (matric number).
  • Foreign key: a field that points to a primary key in another table (matric number in the Results table).

Exams usually ask

  • List six functions of a DBMS.
  • State five advantages of a DBMS over manual processing.

Common mistake

Using a name as the primary key. Two students can share a name; a matric number is unique.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All CSC 182 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.