Relational databases (A3.1 Database fundamentals)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

26 Terms

1
New cards

Database

Organized collection of structured data

  • For storage and manipulation of data (retrieving, managing)

2
New cards

Relational database

Data organized as set of tables with columns/fields/attributes and rows/records/tuples

3
New cards

I. Relationships

Logical association between multiple tables within relational database

  • Table contains 1/+ FKs that reference PKs in other tables = divide and store data in separate tables while connecting data items

4
New cards

One-to-one (I)

One record in table is associated with exactly one record in another table

  • PK corresponds to one or no data

  • Usually rare

  • Ex: Each staff has one ID, each country has one capital, each person has one active passport

5
New cards

One-to-many (I)

One record in table is associated with 1/+ records in another table

  • FK of one table references PK of another table

  • More common

  • Ex: one teacher teaches many subjects, one tourist visits many countries, one person owns many properties, one person has many bank accounts

6
New cards

Many-to-one (I)

1/+ records in table is associated with exactly one record in another table

  • Similar to prev, differ in directionality: availability of entity, side of relationship

  • Ex: many students enroll on single course, many people work for single company, many galaxies in universe

7
New cards

Many-to-many

Multiple records in table have relation with multiple records in another table

  • Linking/associative entity/table - implement relation: create two one-to-many relationships (one between first and linking table, another between second and linking table)

    • e.g. many STUDENTS to many COURSES —> make ENROLLMENT as associative table: many STUDENTS to one ENROLLMENT, one ENROLLMENT to many COURSES

  • Ex: many customers purchase many products, many actors act in many movies

8
New cards

II. Benefits/strengths of relational databases

Benefits/strengths of relational databases

9
New cards

Community support (II)

Most widely accepted model = lots of communities

10
New cards

Concurrency control (II)

Crucial DBMS component: manages simultaneous operations w/o conflicting with each other

  • Purpose: maintain data integrity, consistency, isolation when multiple users/applications access database at once

  • Eg avoiding deadlock

11
New cards

Data consistency (II)

Data remains in consistent state from start to finish so that all copies/instances of data are same across all systems and databases

  • = ^data integrity

12
New cards

Data integrity (II)

Accuracy, completeness, consistency of data throughout lifecycle

  • = ensure data hasn’t been altered unauthorized

13
New cards

Referential integrity (II)

Property: ensure all FK values either match existing PK in related table or are null = consistent relationships

  • When one table has FK that points to PK in another table, means:

    • Can’t insert FK value that doesn’t exist in parent table

    • Can’t delete/change PK in parent table if there are related rows in child table (unless handled with cascade rules)

14
New cards

Efficient and flexible data retrieval (II)

  • SQL allows for complex queries/statements to retrieve exactly data needed

  • Users can create ad hoc queries to retrieve data w/o needing predefined reports/programs

15
New cards

Reduced data duplication (II)

Common fields link tables and match records w/o duplication

  • = v storage needed

16
New cards

Reduced redundancy (II)

Stores less of same data in multiple locations at same time

  • Normalize database - org data into several tables, create relationships, correctly enforce dependencies (see A3.2)

  • Data redundancy = inconsistencies, partial updates, unnecessary duplications

17
New cards

Reliable transacting process (II)

Transaction - sequence of actions performed on data that is considered as single unit

  • Unit of work/logical action independent of other transactions and performed on data by DBMS

  • Either executed fully or not at all

  • = ensure data integrity, reliability

18
New cards

Vertical scalability (II)

Ability of DB to handle increase amounts of data, users, types of requests w/o sacrificing performance, availability

  • Relational DB is vertically scalable: support idea of adding more resources to existing systems (CPU, RAM, etc)

19
New cards

Security features (II)

Control access to shared data

  • = assignment of unique user accounts with specific permissions

20
New cards

III. Limitations/weaknesses of relational DB

Limitations/weaknesses of relational DB

21
New cards

Horizontal scalability (III)

More difficult to scale horizontally (adding data) as size and complexity of data increase

22
New cards

Design complexity (III)

Requires lot of structure, planning to design

23
New cards

Hierarchical data handling (III)

Difficult to store hierarchical data due to mismatch between hierarchical structure and tabular nature

24
New cards

Predefined rigid schema (III)

  • Schema - blueprint/structure of database

  • Can be difficult to define schema: difficult to predict data structure beforehand, changing is complicated and time consuming

25
New cards

Object-relational impedance mismatch (III)

Difficulties when relational database used by program written in object-oriented programming (OOP) languages

  • Due to data type differences: relational doesn’t allow use of by-reference attributes (pointers) which OOP embrace → no clear way to translate all OOP concepts (inheritance, etc) into relational and vice versa

26
New cards

Unstructured data handling (III)

Collection of data where one record differs from another record

  • Being unable to identify common fields/attributes for records makes it impossible to design schema

Explore top flashcards