Test #2 Review Flashcards

1
Q

Entity Type / set

A

denoted as a rectangle

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

Relationship

A

Diamond that connects two entity types

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

Attribute

A

describes a fact about an entity of interest
ex. professors birth date

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

Composite attribute

A

a value that has multiple parts, such as professors name which may have first, middle, last, etc.

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

Derived attribute

A

a value that may be derived from some others attribute in the entity.
ex. age which can be derived from birthdate

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

Multi-valued attribute

A

An attribute named contact numbers may contain several phone numbers at which a professor may be accessed

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

Generally speaking, each ______ will become a table in the database, with its ______ as columns

A

entity type, attributes

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

For relationship types, we need to know about their ____________

A

cardinality constraints

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

Cardinality constraints

A

specify how many instances of related entity types can be associated with each other.

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

Name the ways in which two entities can be associated:

A

one to one
one to many/many to one
many to many

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

Key

A

unique identifier that can be used to distinguish instances in an empty set

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

True/False | There may be multiple keys due to the nature of business data

A

TRUE

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

Candidate key

A

all possible candidate attributes for the primary key

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

Surrogate key

A

An artificially generated identifier, typically an auto-incrementing integer, used to uniquely identify a record.

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

Natural key

A

unique identifier derived from the data itself

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

How is a composite attribute represented

A

Normal circle

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

How is a Derived attribute represented

A

dashed circle

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

How is a multi-valued attribute represented

A

double circle

19
Q

Types of constraints:

A

PRIMARY KEY, UNIQUE, FOREIGN KEY, NOT NULL

20
Q

How to create a table in SQL

A

CREATE TABLE TableName (
data datatype PRIMARY KEY
data datatype UNIQUE NOT NULL
);

21
Q

Foreign key

A

references a key in another table

22
Q

how to specify foreign key

A

FOREIGN KEY REFERENCES tableName (keyName)

23
Q

Data Manipulation Language

A

INSERT
UPDATE
DELETE

24
Q

How to insert into table in SQL

A

INSERT INTO TableName
VALUES ( ‘title’ , number );

25
CHECK
Constraint that allows specificity within data ex. Seats int CHECK (Seats > 0) = only pos seats
26
How to use UPDATE
UPDATE TableName SET AttributeName = newValue (optional) WHERE AttributeName = specificValue
27
How to use DELETE
DELETE TableName WHERE AttributeName = specificValue
28
GETDATE()
Returns datetime value ex. DAY ( GETDATE () ) AS Day
29
DAY ( date ) , MONTH ( date ) , Year ( date )
Returns integer that represents that day, month, year of specified date
30
DATEDIFF
( datepart , startdate , enddate )
31
IIF
IIF ( boolean , true value , false value )
32
LEFT, RIGHT
LEFT ( exp , n) RIGHT ( exp , n ) returns part of character string as specified (n spots from left or right).
33
SUBSTRING
SUBSTRING (expr , start , length )
34
LOWER UPPER
LOWER (str expr) UPPER (str expr) Returns a character expression with letters in the specific case
35
LEN
LEN (str expr)
36
weak entity set
related to a strong entity set, represented by double outline
37
weak entity set never has
primary key
38
composite attributes should be represented as _____ in relational model
individual attributes
39
combining strong and weak entity set into table
take PK from strong and combine with all weak attributes
40
combining many to many relationships
take PK from both entities to form table
41
How to handle Multivalue attributes
create new table and store as FK in old ex. Locations -> location and locationID (FK)
42
To handle many to many relationship
create table of relationship and store PK of both as well as any attributes from relationship
43
To handle 1 to many relationship
Put the PK from 1 into many table`
44