0% found this document useful (0 votes)
940 views9 pages

MySQL - Week 1 Quiz

This document contains a 15 question multiple choice quiz on relational databases and relational schemas. The questions cover topics like the mathematical theory that relational databases are based on (set theory), identifying primary keys, foreign keys, and cardinality constraints in entity relationship diagrams, combining information between tables using foreign key relationships, and the requirements of set theory for efficient relational databases like each row representing a unique instance and columns representing unique categories of information.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
940 views9 pages

MySQL - Week 1 Quiz

This document contains a 15 question multiple choice quiz on relational databases and relational schemas. The questions cover topics like the mathematical theory that relational databases are based on (set theory), identifying primary keys, foreign keys, and cardinality constraints in entity relationship diagrams, combining information between tables using foreign key relationships, and the requirements of set theory for efficient relational databases like each row representing a unique instance and columns representing unique categories of information.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

MySQL - Week 1 quiz

!. Relational databases are based on which mathematical theory or field?

Probability theory

Matrix algebra

Set theory (MINE)

Information theory

Question 2

YearsInBusiness in the ER diagram above is a:

Candidate key

Derived attribute (MINE)

Unique attribute

Composite attribute

Question 3
Which of the following is true about cardinality constraints on the relationship
between Doctor and Outpatient Location depicted in this ER diagram?

A doctor can work at many outpatient locations, but does not have to work at any.

An outpatient location must have at least 1 doctor working at it, but can have many
doctors working at it.

A doctor is required to work at one outpatient location, but can work at no


more than 1 outpatient location. (MINE)

An outpatient location must have 1 doctor working at it, but can have no more than
1 doctor working at it.

Question 4

Which columns would be necessary for identifying unique doctors in the doctor
table of the database built from the relational schema excerpt above?

You would have to use both LicenseNo and State (MINE)

State

You could use either LicenseNo or State


LicenseNo
 
Question 5

In the ER diagram above, Doctor_ID and OL_ID are called:

Unique attributes

Foreign keys

Composite attributes or keys (MINE)

Primary keys
 
Question 6
Which type of information is most likely to be stored in a relational database as
opposed to another type of database?

Pictures

Tweets

Texts

Metadata (file name, file location, when the file was created, etc.) about
pictures (MINE)

Question 7
What can you infer about the data being collected based on the relational schema
above?

The data collected in OL_ID of the WorksAt table, on its own, is sufficient to
determine at which outpatient location(s) each doctor works

A doctor can only work at one outpatient location, but an outpatient location can
have many doctors working at it

A doctor can work at many outpatient locations, and an outpatient location


can have many doctors working at it (MINE)

The data collected in OL_ID of the OutpatientLocation table, on its own, is


sufficient to determine at which outpatient location(s) each doctor works

Question 8

Based on the diagram above, which attribute(s) can be used to identify unique
books?

BookName and WriterID (MINE)

BookName and BookPubDate

BookName
BookName and EditorID

Question 9
Which of the following statements are true about foreign keys? Check all that
apply. (Note that you will need to select more than one correct response to answer
this question correctly.)

Foreign keys allow information in different tables to be linked to each other


(MINE)

Foreign keys are columns with unique values for every row in the relation/table
they are in

Foreign keys refer to columns with unique values for every row in other
relations/tables (MINE)

Foreign keys always have the same name as at least one primary key in another
table

Question 10

Given the relational schema presented above, how many tables would you need to
use in order to determine the outpatient location(s) a doctor named "Karen Smith"
works at?

3 (MINE)

2 or 3, depending on the strategy you use to combine the information

1
 
Question 11
Which of the following is true about cardinality constraints on the relationship
between Doctor and Outpatient Location depicted in this ER diagram?

A doctor is required to work at one outpatient location, but can work at no more
than 1 outpatient location.

An outpatient location must have at least 1 doctor working at it, but can have
many doctors working at it. (MINE)

A doctor can work at many outpatient locations, but does not have to work at any.

Each outpatient location must have 1 doctor working at it, but can have no more
than 1 doctor working at it.

Question 12
Which of the following statements are true about the technical terms (as
opposed to the common terms) for the concepts represented by relational
schemas?

The technical term for items in a relational schema that become tables in a real
database is “entities”

The technical term for items in a relational schema that become rows in a real
database is “tuples.” (MINE)

The technical term for items in a relational schema that become columns in a real
database is “fields”

Question 13
Based on the diagram above, which of the following is true?

ShowType and ShowName are needed together to provide a unique identifier for
each show

ShowDate and ShowVenue are needed together to provide a unique identifier


for each show (MINE)

ShowType and ShowVenue are needed together to provide a unique identifier for
each show

ShowID and ShowVenue are needed together to provide a unique identifier for
each show
 
Question 14

If this relational schema represented a database that was already implemented,


what columns would you use to combine the information in the transactions table
with the information in the departinfo table?

sku” to connect the transactions table to the skuinfo table, and then “deptID”
to connect the skuinfo table to the deptinfo table (MINE)

“deptname” to connect the transactions table to the deptinfo table

“sku” to connect the transactions table to the skuinfo table, and then “deptname”
to connect the skuinfo table to the deptinfo table

“store” to connect the transactions table to the storeinfo table, and then
“deptname” to connect the storeinfo table to the deptinfo table

Question 15
For relational databases to work most efficiently, which of the following
requirements of set theory should be followed? Check all that apply. (Note that
you will need to select more than one correct response to answer this question
correctly.)

Each row in a table should represent a unique instance of the information in


that table (MINE)

Each column in a table should represent a unique category of information


(MINE)

Single tables should represent the smallest logical parts of a data set (MINE)

There should be no NULL values allowed in the database

——————————————————————————————————

Wk 1 Relational Schemas Written Exercises Note

Before you download the written exercises, please read this very important note
about direction of arrows in Relational Schema.
The arrow goes from the table that has a foreign key to the table where the key
comes from (so the arrow points to the primary key).
Try to design a database so that each table has a unified theme with a unique
identifier on each row that is consistent with that theme.
Whenever you have a 1cMany relationship, the relation mapped from the entity on
the Many side of the relationship should get a foreign key that corresponds to the
primary key of the relation on the 1 side of the relationship. This is because you
would have to have duplicate values of the unique identifier of the entity on the 1
side in the table that represents the entity on the Many side.
An example is the description of the database in Question 5 of the relational
Schema exercise said:
"Investment companies can manage multiple mutual funds. Investco Scout will not
keep track of investment companies that do not manage any mutual funds. A
mutual fund is managed by one investment company."
Thus, there is a 1cMany relationship between investment companies (1) and mutual
funds (many), and there should be a foreign key in the mutual funds table that
points to the primary key in the investment company table.
Whenever you have a 1c1 relationship, by the way, it doesn't matter which table has
the primary vs. foreign key. Whenever you have a Many:Many relationship, on the
other hand, recall that you will need a separate linking table that will have two
foreign keys corresponding to the primary keys of the tables that represent the
entities in the Many:Many relationship.

You might also like