Databases Flashcards

(47 cards)

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
What is a tuple in SQL?
A tuple is whats commonly refered to a row in a table, it is an individual entry in the Database
26
What is a primary key in SQL?
A Primary key is a unique identifier with which an entry can be identified
27
What is a composite key in SQL?
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
What is a candidate key in SQL?
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
What are the two criteria of the first normal form?
- Contains only atomic values | - There are no repeating groups
30
How many join types the ANSI SQL standard have?
5: | INNER, LEFT OUTER, RIGHT OUTER, FULL OUTER, CROSS
31
What does a CROSS JOIN of two tables return in set theory terms?
A Carthesian Product
32
What does an INNER JOIN of two tables return?
Returns the set of records that match in both tables
33
What does a FULL OUTER JOIN of two tables return?
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
What concepts a simple key-value store has to store data?
what? (maybe key, value)
35
What are the three concepts of a graph database?
Nodes, Edges and Properties
36
What does OLTP stand for?
Online Transaction Processing
37
What does OLAP stand for?
Online Analytical Processing
38
What does ACID stand for?
Atomicity, Consistency, Isolation, Durability
39
What are the two most popular data storage options?
Row oriented and Collumnar oriented Data Storage
40
What are the advantages of row-oriented data storage?
- Easy to insert a new row - Transactions are concerned about a single row - Row level security can be used with this design
41
What are the disadvantages of row-oriented data storage?
- Reading an entire row while only needing a single collumn
42
What are the advantages of columnar-oriented data storage?
- Reading a single column results in reading the minimum amount of data - Advanced techniques can be applied using the columnar aproach
43
What are the disadvantages of columnar-oriented data storage?
- Hard to update | - Hard to insert into
44
Which data storage is better suited for OLTP use cases?
Row Data Storage
45
Which data storage is better suited for OLAP use cases?
Collumnar Data Storage
46
What are the three letters stand for in CAP theorem?
Consistency, Availability, Partition Tolerance
47
What does ETL stand for?
Extract, Transform, Load