Exam 2 Flashcards

(52 cards)

1
Q

Keys

A

a group of one or more attributes which uniquely defines a row

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

Surrogate keys

A

: a DBMS-supplied identifier of each row of a table.

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

Foreign keys

A

is an attribute (or collection of attribute) in one table that uniquely identifies a row of another table.

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

triggers

A

modules of code that are invoked by the DBMS when specific events occur.

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

cascading updates

A

propagating a change from the parent’s primary key to the children’s foreign key.

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

cascading deletes

A

deleting the children along with the parent.

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

how many relationships are needed and which keys go where for an id-dependent weak entity relationship

A

an entity whose identifier includes the identifier of another entity
two relations
one parent, one child
key of child is combination of parent key plus its own key
Used for multivalued attributes, archetype/version, and associations

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

how many relationships are needed and which keys go where for an 1:1 has-a entity relationship

A

each entity gets its own relation
the key of one is a non-key FK in the other
doesn’t matter which
if 1:1 and mandatory both ways, then they should probably be combined into one relation.

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

how many relationships are needed and which keys go where for an 1:M has-a entity relationship

A

each entity gets its own relation
key of parent must be FK in the child
usually, but not always, not part of key
child points to parent

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

how many relationships are needed and which keys go where for an M:N has-a weak entity relationship

A

three relations must be used
one for each original entity
one for “intersection” (assoc) relation
key to intersection will contain, at least, the keys of both parents
always a composite key
often contains additional attributes, for uniqueness
Always ID-dependent

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

how many relationships are needed and which keys go where for an recursive 1:1, 1:M, and M:N entity relationship

A

same as non-recursive has-a type relationships
you will have multiple columns with the same syntactic content but they will have different semantics
some rows are parent rows, some are child, some both, some neither

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

how many relationships are needed and which keys go where for an is-a entity relationship

A

one relation for supertype

one relation for each subtype

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

Define a BOMP relationship

A

Bill of Materials Processing is a class M:N recursive pattern.

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

what is the structure of a BOMP relationship

A
\_\_\_\_\_\_\_\_\_
|PartName|
|OtherData|>-------|
        V                |
         |\_\_\_\_\_\_\_\_ |
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

define relational algebra DML

A

procedural, complex, not common

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

define relational calculus DML

A

nonprocedural, theoretical, not used

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

define transform oriented DML

A

somewhat procedural, somewhat nonprocedural
simple, most common
SEQUEL, SQL, etc

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

define the graphical DML

A

QBE/QBF

simple, limited

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

define union operation

A

adding the tuples from one relation to those of a second relation to produce a third relation.

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

define the difference operation

A

a third relation containing tuples that occur in the first relation but not in the third.

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

define the intersection operation

A

a third relation of the tuples that appear in both, the first and second relation.

22
Q

define theproduct operation

A

concatenation of every tuple of one relation with every tuple of the second relation.

23
Q

define the project operation

A

an operation that selects specified attributes from a relation. (picks columns)

24
Q

define the select operation

A

identifies tuples to be included in the new relation. (picks rows)

25
define the equijoin operation
cross + select
26
define the natural join operation
project eliminates duplicate column
27
define the inner join operation
must match in both tables
28
define the outer join left and right operations
-left/right: only needed in one table
29
define union compatibility
corresponding columns from same domains
30
what criteria is need for the joins
Joins restore what normalization destroys.
31
give a background on SQL
Structured Query Language (SQL) is a data sublanguage that has constructs for defining and processing a database
32
explain SEQUEL
SQL: was developed by IBM in late 1970s
33
explain SQL-92
was endorsed as a national standard by ANSI in 1992
34
explain SQL3
incorporates some object-oriented concepts but has not gained acceptance in industry
35
memorize the chart
``` OPERATION || METADATA || DATA create || create || insert change || alter || update delete || drop || delete display || show || select ```
36
SELECT statements
can be used to obtain values of specific columns, specific rows, or both
37
Select clause
specifies which columns are to be listed in the query results
38
From clause
specifies which tables are to be used in the query
39
Where clause
specifies which rows are to be listed in the query results
40
Comparison operators
less than and greater than symbols
41
LIKE
to specify a single or multiple unknown characters
42
IN, NOT IN
indicate 'match any' and 'match all' sets of values
43
DISTINCT
eliminate duplicates
44
AND/OR
may be used for compound conditions
45
BETWEEn
specify ranges of data values
46
ORDER BY
sort the results generated
47
GROUP BY
rows can be grouped according to common values
48
COUNT
returns the number of values for a specified column name. Variations: COUNT(*) returns the number of records in a table COUNT(DISTINCT column_name) returns the number of distinct values
49
SUM
Returns the total sum of a given numeric column. | Ex: SELECT SUM(quantity) AS TotalNumItemsOrdered FROM orders;
50
AVG
Returns the average value of a given numeric column. | Ex: SELECT AVG(price) AS PriceAvg FROM products;
51
MAX
Returns the largest value of a selected column. | Ex: SELECT MAX(price) AS HighestPrice FROM products;
52
MIN
Returns the smallest value of a selected column. | Ex: SELECT MIN(price) AS LowesttPrice FROM products;