Databases (Ultimate Deck) Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Distinction between Data and Information

A

Data is just raw facts, numbers and figures
(e.g. 1975)

Information is data that has been given a context and meaning.
(e.g. The Vietnam war ended in 1975)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Database

A

An organized collection of structured information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the software called that creates, defines, and manipulates a database?

A

Database Management System (DBMS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the things at the top of columns in a database that describe what’s inside that column?

A

Fields/Attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a row in a database referred to?

A

A record

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Benefits of a database

A
  • Enables for processing/querying of data
  • Can easily generate reports
  • Standardized (can be used by multiple systems)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Data Verification (in context of databases)

A

This is the checking that input matches expected values in database

E.g. login details of a user matches those stored in the database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Data Validation (in context of databases)

A

Checks that input follows rules for the type of input entered

For example: CVV code should be 3 numerical digits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Entity

A

A real-world object or person represented by a record in a database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Primary Key

A

A unique key used to identify a given record in a database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Foreign Key

A

A field in one table that refers to the primary key field in another table. It is used to connect (relational) databases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

6 different types of data types

A
  • Text:
    Combination of letters, numbers or symbols. Basically a string.
  • Character:
    In individual letter, number or symbol
  • Boolean:
    A binary value (True/False, Yes/No)
  • Integer:
    A whole number
  • Real:
    A decimal number
  • Datetime:
    A date and/or time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Write the SQL to get ProductName from the table Products where the price is more than 20 but less than 25

A

SELECT ProductName FROM Products WHERE Price > 20 AND Price < 25

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Secondary Key

A

Keys that are also capable of functioning as a primary key. Also known as the alternate key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

2 differences between Primary and Secondary Key

A

Primary Key - Cannot be Null, only one primary key possible

Secondary Key - Can be Null, multiple secondary keys possible

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Candidate Key

A

Umbrella term for keys that can uniquely identify each record in a database

Both primary and secondary keys are candidate keys

17
Q

Composite Primary Key

A

When one field is not enough to uniquely identify records, two fields can function together as the primary key

18
Q

Database schema

A

A diagram of how data is organized in a relational database.

This means a diagram showing table names, fields, data types of fields, and relationships between tables

19
Q

Records can also be referred to as?

A

Tuples

20
Q

Referential Integrity

A

This is a feature of relational databases. What this means is every row has a primary key, and that every value in a foreign key column will be found in the primary key of the table from which it originated.

21
Q

Concurrency, and what does it use to prevent more than one user accessing the same row/record at the same time?

A

This is the process referred to managing simultaneous updates or transactions at the same time. It ensures updates/transactions occur sequentially to avoid collision between users’ actions.

Row locking

22
Q

Data Dictionary

A

A file or set of files that stores how the information and tables should be organized and stored in a database

23
Q

How does DMBS provide security to a database? (5 ways)

A
  • Access Rights
  • Audit trials (Record of any changes to the database)
  • Data/Row Locking
  • Encryption
  • Backups - Continually updated copes that can be accessed in case the original database is lost or corrupted
24
Q

Transaction

A

A sequence of one or more SQL statements that are executed as a single unit of work. A transaction can either be committed (applied to the database) or rolled back (undoing something). Essentially, it allows us to make temporary changes, making data integrity easier.

25
Q

Different states in transactions?

A

Active State
Partially Commited State
Commited State
Failed State
Aborted State
Terminated State

26
Q

What is the acronym for ACID?

A

Atomicity:
All tasks in a transaction are performed if successful. Else no tasks are performed.

Consistency:
All data written must be valid according to existing rules.

Isolation:
No transactions will collide/interfere with another. Sequential execution of transactions.

Durability:
Once a transaction is complete, the change to the database is permanent, even if there is system failure.

27
Q

Why do we have transactions?

A

They make sure there is never a case where there were incomplete changes.

28
Q

Log

A

Records every change making it easier to roll back

29
Q

Data Integrity

A

Accuracy:
The correct data and relationships are retained and preserved

Completeness:
All data needed is available

Validity:
Data meets all predetermined rules

30
Q

Audit Trail

A

This records all changes, login attempts, and other security related events to help detect and investigate security breaches.

31
Q

Data Redundancy

A

This is what happens where the same piece of data is stored in multiple places. It can happen in different or the same tables.

32
Q

Data Redundancy Pros & Cons

A

Pros:
- Faster data access speeds
(more locations from which data can be accessed)

  • Better data protection:
    In case of loss of data, it can be replaced from another location

Cons:
- Data inconsistency:
If data is updated at one location, other locations may not be updated as well

  • Takes more memory (more expensive)
33
Q

Normalization

A

This is the process in which larger tables in a database are divided into smaller tables to reduce data redundancy while ensuring data integrity.

34
Q

What are the different Normal forms, and at each step what do they seek to eliminate?

A

1st Normal form (1NF)
- Eliminate duplicate columns, columns with multiple types of values
- Create separate tables for each group of related data (with unique primary keys)

2nd Normal Form (2NF)
- Meet all the requirements for 1NF
- Eliminate partial dependency (Columns that are dependent on one attribute of a composite primary key)

3rd Normal Form (3NF)
- Meet all the requirements for 2NF
- Eliminates transitive dependency

35
Q
A