Lecture 19+20 Flashcards

1
Q

What is a multilevel index? What can it be used with?

A

First level is an ordered file, the second level is a primary index of the first and so on. This can be used on primary, clustering, or secondary indexes. Though there are problems with insertion and deletion.
They basically function like search trees.

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

What are the requirements of a search tree of order p?

A

Each node has at most p-1 search values, and p pointers, each pointer points to a child or a NULL. All search values should be unique, there must always be exactly one less search value than pointers and all values in child trees should be less than the search value.

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

Why are search trees not guaranteed to be balanced by default?

A

Tree balance is sensitive to insertion order. Also deletion can lead to nodes which are close to empty.

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

What is a B-Tree?

A

A search tree, but the tree must always be balanced, and space wasted by deletion, if any, must never be excessive.
To achieve this:
Each node must be at least half full(except root and leaf nodes).
A node has 1 less search key field values than pointers.
All leaf nodes must be at the same level, and must point to NULL.

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

What is a B+ tree?

A

B-tree variant, all data pointers are stored only in leaf nodes. Leaf node structure differs from internal node structure, and are typically linked together to allow for ordered access. More entries can be packed into an internal node for a B+ tree than a B tree due to no data pointers in internal nodes of B+

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

What are the nodes of a B+ tree like?

A

Each internal node has one less search key field than pointers and pointers >= the order of the tree. All values in subtree should stay within the brackets of the search field values they came from.
Each leaf node has a key field and a pointer pairing, up until the final pointer, which is a pointer to the next leaf of the B+ tree. Each leaf node has at least order/2 values and all leaf nodes are at the same level.

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

What is a B* tree?

A

A B+ tree, but each node must be 2/3 full.

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

What are the disadvantages of indexes?

A

Add overhead when inserting, deleting, and possibly updating.
Indexes should be added after the data in the event of a mass load.

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

How do we create and drop indexes in SQL?

A

CREATE INDEX ON (column);

DROP INDEX

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

What is security with regards to databases?

A

Protection of the database against unauthorized access, either intentional or accidental.

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

What are the main control measures?

A

Access control: user account and password.
Inference Control: statistical database security.
Flow Control: prevent information from reaching unauthorized users.
Data encryption: Protect sensitive data.

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

Who is responsible for access control? How is it done?

A

The database administrator. They have an account known as the superuser, it allows for account creation for overall access, privilege granting and revocation(discretionary), and security level assignment(mandatory).

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

What are the two approaches to DB security?

A

Discretionary: this is done in most commercial DBMSs. A user may have different access rights to different objects, different users may have different rights on the same object. This is very flexible.
Mandatory: Used in some DBMS for government/military type operations.
Each object tagged with classification level, each user has a level, the data object can only be accessed by users with appropriate clearance. This is very rigid.

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

How does mandatory access control work?

A

There are 4 levels: top secret > secret > confidential > none. Users can not read higher than their rank and can not write lower than their rank. This prevents lowering the security of objects.

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

How does discretionary access control work?

A

granting and revoking of privileges, providing selective access to relations based on specific users. Two levels are account level(different rights on same object) and relation level(different access rights to different objects).
Each table has an owner, they can grant privileges to their tables, types of privileges are SELECT, MODIFY or REFERENCES (can be referenced in constraints). Or views.
GRANT gives privileges to tables, REVOKE removes them.

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

What are the main object privileges?

A

SELECT, INSERT, UPDATE, DELETE, ALTER, EXECUTE, INDEX, REFERENCE.

17
Q

What is a role?

A

A group of related privleges, they can be created with CREATE ROLE ; and then granting it privileges, the role can then be granted to users.

18
Q

What is the problem with WITH ADMIN OPTION?

A

WITH ADMIN OPTION allows whoever was given it the ability to grant privileges to other users, allowing privileges to propagate without owner knowledge.

19
Q

Why is statistical database security important?

A

In cases where only statistical information is retrievable it may be important to prevent retrieval of individual data, which may be possible from a sequence of statistical queries. Possible techniques inclue prohibiting statistical queries when number of tuples specified is too low or by prohibiting queries which repeatedly refer to same tuples.