Query Processing Flashcards

1
Q

Codd defintions of relational algebra: What is a product?

A

create longer relations by combining others

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

Codd defintions of relational algebra: What is a select?

A

filter tuples of a longer relation, using a predicate

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

Codd defintions of relational algebra: What is a project?

A

creater shorter relation, with fewer places

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

Codd defintions of relational algebra: What is a join?

A

similar to product, but merging one or more places

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

What is a Natural Join of 2 tables?

A

joining two tables on same-named columns, matching attributes, omits rows with no match

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

What is an Inner Join of 2 tables?

A

joins tables on two explicitly named columns, not necessarily with same name

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

What is a Left outer (right outer) Join of 2 tables?

A

includes LH (RH) rows with no matches in the RH (LH) tables

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

WHat is a full outer join of 2 tables?

A

Union of left and right outer joins.

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

What are the main differences between SQl and relational algebra?

A

SQL returns lists, not sets
SQL has additional syntax for defining, manipulating and querying tables
SQL has poorly chosen operation names ( SQL select does project, SQL where does select)

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

WHat is an aggregate function?

A

Non-relational part of sql

summarising sets of data to yield statistics

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

Why are aggregate functions useful?

A

Summarising data is what users seem to want

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

What are somethings that cause issues with query efficiency?

A
  • how many rows need to be found (time)
  • how difficult it is to find them (joins)
  • where to store intermediate results (space)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are some possible approaches to improve query optimization?

A
  • structure queries using subqueries
  • filter large data sets before joining
  • project columns before joining
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the benefits of indexing in terms of searching data sets?

A

index refers to row position in a large file can offer faster random access to a row by its index

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

What method do we use to handle very large data sets?

A

B-tree; a memory graph that maps primary keys to row indices

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

What are the search properties of a B tree?

A
  • fast access to the data

- insert/delete modifies few nodes