COMP3 - Databases Flashcards
File Based Disadvantages
Data Inconsistency - different addresses for 1 person.
Data Redundancy - some information recorded twice.
Difficult to Maintain - have to manipulate large amounts of data.
Program-data Dependence - file structure is not defined in an accessible way. If data structure changes, so does the program.
Database Definition
Organised collection of related data.
Printed databases - Telephone directory, Address book.
Electronic Databases - Studio, Library Catalogue, Amazon.
Maintaining Data Dictionary
Database Management Systems (DBMS) creates & maintains data dictionary.
Data Definition Language (DDL):
- Used to create tables.
- Records attributes, data types, validation.
- Defines which attributed belong to which tables.
- Creates users & grants access.
Data Manipulation Language (DML) used to add/manipulate data in the database.
Open Database Connectivity (ODBC)
Provides an open standard Application Program Interface (API) method for using DBMS.
Independent of programming languages, database systems & OS.
Database created using one piece of software can be viewed using other software.
Database Sharing
DBMS manages facilities for sharing the DB.
More than 1 user sharing the DB, they could attempt to update data at the same time.
DBMS gives access rights to first user to open record and read-only to further users.
Deadlock when 2 users attempt to update same 2 related records in the same table.
Database Schema
External/User:
- How the user sees the DB
- Can be several external schema for each user’s view.
Conceptual/Logical:
- Describes entities, attributes & relationships.
Internal:
- How the data will be stored, accessed & updated.
Client-Server Database
Server holds the DB & client accesses it via the server.
Communication time minimised as only query is sent to the server.