Chapter 3: Intro to SQL; Chapter 4: Intermediate SQL Flashcards

1
Q

def: aggregate functions

A

operate on multiset of values of a column and return a value

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

aggregate functions (5)

A
  • avg
  • min
  • max
  • sum
  • count
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

def: natural join

A

matches tuples with the same values for all common attributes, retains only one copy of each common column

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

def: outer join

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

def: join operations

A

takes two relations and returns another relations as result

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

def: join condition

A

defines which tuples in 2 relation match

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

def: join type

A

defines how tuples that do not match are treated based on join condition

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

def: view

A

a way to hide some data from view of users

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

def materialized view

A

physical copy of a view

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

view v1 depends directly on view v2 when…

A

v2 is used in expression defining v1

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

view v1 depends on view v2 when…

A

v1 depends directly on v2 or there is a path dependencies from v1 to v2

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

view v is recursive when….

A

it depends on itself

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

def: transaction

A

a sequence of query and/or update statements and is a ‘unit’ of work

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

transaction must end with one of the two statements (2)

A
  • commit work
  • rollback work
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

def: commit work

A

updates performed by transaction become permanent

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

def: rollback work

A

all updates performed in transaction are undone

17
Q

def: atomic transaction

A

either fully executed or rolled back as if never occurred

18
Q

purpose of integrity statements

A

guard against accidental damage to database by ensuring that authorized changes do not result in loss of data consistency

19
Q

constrains on a single relation (4)

A
  • not null
  • primary key
  • unique
  • check(p) where p is predicate
20
Q

def: assertion

A

predicate expressing condition that we wish the database would always satisfy

21
Q

def: attribute index

A

a data structure that allows database system to find tuples that have specified value efficiently

22
Q

def: grant command in SQL

A

used to give authorization

23
Q

def: revoke command in SQL

A

remove authorization

24
Q

def: role in SQL

A

a way to distinguish among various users and what they can access/update