WK4 Introduction to databases Flashcards

1
Q

Database

A

An organized collection of information or data.

Databases can be accessed by multiple people simultaneously and can store massive amounts of data.

Databases can also perform complex tasks while accessing data.

As a security analyst, you’ll often need to access databases containing useful information.

For example, these could be databases containing information on login attempts, software and updates, or machines and their owners.

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

Relational Database

A

A relational database is a structured database containing tables that are related to each other.

Relational databases often have multiple tables.

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

Keys

A

The columns that relate two tables to each other are called keys.

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

2 types of keys

  1. Primary key
A

The first is called a primary key. The primary key refers to a column where every row has a unique entry. The primary key must not have any duplicate values, or any null or empty values. The primary key allows us to uniquely identify every row in our table.

For the table of employees, employee_id is a primary key. Every employee_id is unique and there are no employee_ids that are duplicate or empty.

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

2 types of keys

  1. Foreign Key
A

The foreign key is a column in a table that is a primary key in another table. Foreign keys, unlike primary keys, can have empty values and duplicates. The foreign key allows us to connect two tables together. In our example, we can look at the employee_id column in the machines table. We previously identified this as a primary key in the employees table, so we can use this to connect every machine to their corresponding employee.

It’s also important to know that a table can only have one primary key, but multiple foreign keys.

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