Databases Flashcards

1
Q

What is a database?

A

An organized collection of structured information or data, stored electronically

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

What was the first kind of database?

A

Navigational Database

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

What is the query language for navigational databases?

A

CODASYL (Conference/Committee on Data Systems Languages)

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

What is the primary benefit of a navigational database over reading data sequentially?

A

Navigational databases allow to navigate directly from record to record following relations

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

Who invented relational databases?

A

Dr. Edgar Codd

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

What is the entity-relationship model used for?

A

To model data in databases using relationships and to help navigating a database

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

What are the three subcomponents of a relationship in ER models?

A

Entities, Atributes and Relationships

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

How many cardinality types an entity-relationship can have?

A
4:
Zero or one
Exactly One
Zero or More
One or More
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the sign of a mandatory one (exactly one) cardinality type in crow’s foot notation?

A

||

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

What is the sign of an optional one (zero or one) cardinality type in crow’s foot notation?

A

o|

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

What is the sign of a mandatory many (one or more) cardinality type in crow’s foot notation?

A

|{ or }|

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

What is the sign of an optional many (zero or more) cardinality type in crow’s foot notation?

A

o{ or }o

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

What is the data type for missing data in a relational database?

A

null

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

What is the query language used for relational databases?

A

SQL

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

What does DDL stand for?

A

Data Definition Language

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

What does DML stand for?

A

Data Manipulation Language

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

What does DCL stand for?

A

Data Control Language

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

How do you create a table in SQL?

A

CREATE TABLE a (a INTEGER);

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

How do you read data from a table in SQL?

A

SELECT * FROM a

20
Q

How do you add data to an SQL table?

A

INSERT INTO a (a)
VALUES
(1),
(2);

21
Q

How do you delete data from an SQL table?

A

DELETE FROM a WHERE a=1

22
Q

How do you modify data in an SQL table?

A

UPDATE a SET a=”new” WHERE a=1

23
Q

How do you investigate what a query actually does in SQL?

A

EXPLAIN QUERY PLAN SELECT * FROM a

24
Q

What is an attribute in SQL?

A

An attribute is whats commonly refered to as a column in a table and stores one single datapoint per entry in the Database

25
Q

What is a tuple in SQL?

A

A tuple is whats commonly refered to a row in a table, it is an individual entry in the Database

26
Q

What is a primary key in SQL?

A

A Primary key is a unique identifier with which an entry can be identified

27
Q

What is a composite key in SQL?

A

A composite key is a combination of two or more Primary and Foreign keys in a joining table used to secure the uniqueness of entries into the joining table

28
Q

What is a candidate key in SQL?

A

A candidate key is a natural, domain or business key. The Candidate key is unique, might be primary and can be null, which is why it cant be a primary key

29
Q

What are the two criteria of the first normal form?

A
  • Contains only atomic values

- There are no repeating groups

30
Q

How many join types the ANSI SQL standard have?

A

5:

INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER, CROSS

31
Q

What does a CROSS JOIN of two tables return in set theory terms?

A

A Carthesian Product

32
Q

What does an INNER JOIN of two tables return?

A

Returns the set of records that match in both tables

33
Q

What does a FULL OUTER JOIN of two tables return?

A

Returns every record from all tables, if no matching record can be found to a record it will be matched with a null value

34
Q

What concepts a simple key-value store has to store data?

A

what? (maybe key, value)

35
Q

What are the three concepts of a graph database?

A

Nodes, Edges and Properties

36
Q

What does OLTP stand for?

A

Online Transaction Processing

37
Q

What does OLAP stand for?

A

Online Analytical Processing

38
Q

What does ACID stand for?

A

Atomicity, Consistency, Isolation, Durability

39
Q

What are the two most popular data storage options?

A

Row oriented and Collumnar oriented Data Storage

40
Q

What are the advantages of row-oriented data storage?

A
  • Easy to insert a new row
  • Transactions are concerned about a single row
  • Row level security can be used with this design
41
Q

What are the disadvantages of row-oriented data storage?

A
  • Reading an entire row while only needing a single collumn
42
Q

What are the advantages of columnar-oriented data storage?

A
  • Reading a single column results in reading the minimum amount of data
  • Advanced techniques can be applied using the columnar aproach
43
Q

What are the disadvantages of columnar-oriented data storage?

A
  • Hard to update

- Hard to insert into

44
Q

Which data storage is better suited for OLTP use cases?

A

Row Data Storage

45
Q

Which data storage is better suited for OLAP use cases?

A

Collumnar Data Storage

46
Q

What are the three letters stand for in CAP theorem?

A

Consistency, Availability, Partition Tolerance

47
Q

What does ETL stand for?

A

Extract, Transform, Load