Week 1.5 Flashcards

1
Q

Reasons for using ISA (sub classes)

A

1) To add descriptive attributes to the subclass

2) To Identify entities that participate in a relationship

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

ER Is used for what

A

Conceptual database design

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

3 Basic constructs of ER

A

1) entities
2) relationships
3) attributes (of entities and relationhsips)

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

Overlap Constraints:

A

determine whether the entities in the subclass collectively include all entities in the superclass

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

What is a characteristic of covering constraints?

1) Determine whether the entities in the subclass collectively include all superclass entities
2) Determine whether the subclasses have different entities in the class
3) Determine whether the subclasses have permission to contain the same class

A

1) Determine whether the entities in the subclass collectively include all superclass entities

Correct
In the example, all the contract/hourly employees belong to the master employees entity which explains covering constraints.

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

Overlapping Constraints

A

determine whether two subclasses are allowed to contain the same class entity

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

Aggregation

A

Allows relationships with relationship sets

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

Duration

A

ternary relationship

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

ternary relationship

A

A ternary relationship is when three entities participate in the relationship.

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

A university database records professors that taught subjects in courses. Based on the entities participating in the relationship, what kind of relationship is this?

1) Ternary relationship
2) Binary relationship

A

Ternary relationship

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

What does ISA mean

A

It is a member of a higher class

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

In a Database the Number of Rows are called

A

cardinality = count(*)

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

In a Database the Number of Fields are called

A

degree (id,fname,etc)

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

If you would like to insert a new company tuple in your corporation’s table, what is the most likely correct command?

1) INSERT INTO COMPANY ( NAME, CITY, STATE)
(“ASU CORP”, “TEMPE”, “AZ”)

2) INSERT INTO COMPANY
VALUES( 3, “ASU CORP”, “TEMPE”, “AZ”)

3) INSERT INTO COMPANY (NAME, CITY, STATE)

VALUES (“ASU CORP”, “TEMPE”, “AZ”)

A

INSERT INTO COMPANY (NAME, CITY, STATE)

VALUES (“ASU CORP”, “TEMPE”, “AZ”)

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

Integrity Constraints

A

Integrity constraints ensure that the data insertion, updating, and other processes have to be performed in such a way that data integrity is not affected.

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

Primary Key Constraints

A

niquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL values.

17
Q

Super Key

A

A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table.

18
Q

Foreign key database

A

A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables. … The concept of referential integrity is derived from foreign key theory. Foreign keys and their implementation are more complex than primary keys.

19
Q

What is a tuple?

A

A tuple is a set of sets, defining a container with order. In SQL, it is used to represent a row. SQL uses sets of tuples to do it’s magic - model and retrieve data. Simply put, a tuple is a row in a table. A field or attribute of a table is a column.

20
Q

Why is referential integrity important?

1) It ensures a tight relationship between foreign keys in a table.
2) It ensures the correctness of data within a DBMS.
3) It ensures multiple primary keys to exist in a tuple.

A

2) It ensures the correctness of data within a DBMS.

21
Q

Ways to deal with a delete in a foreign key (data) when the primary key (data) is deleted from the database

A

1) Do Nothing
2) cascade delete
3) reject
4) Set Null

22
Q

When creating a join table use what primary key

A

From both tables to create a multiple columns primary key (they are also foreign keys)

23
Q
In the following SQL, what is/are the key constraints? 
CREATE TABLE Employees (
    employee_id INTEGER,
    badge_id INTEGER,
        PRIMARY KEY (employee_id),
        FOREIGN KEY (badge_id) REFERENCES Badge
    );
1) PRIMARY KEY and FOREIGN KEY
2) FOREIGN KEY
3) PRIMARY KEY
A

1) PRIMARY KEY and FOREIGN KEY

24
Q

sql participation constraint definition

A

t specifies that each entity in the entity set must compulsorily participate in at least one relationship instance in that relationship set. That is why, it is also called as mandatory participation.

25
Q

sql participation constraint code

A

NOT NULL,

26
Q

Weak Entity set should have

1) keys?
2) Delete super?

A

1) foreign key (part of primary key)

1) On Delete Cascade (delete if primary key deleted)