mis final practice
first normal form is designed to ensure that ________. select the correct answer to fill in the gap A) there are no repeating fields in a table & the fields are atomic B) all of the data in a DB is represented in one data table C) there are no duplicate key fields in a table D) none of the above
A) there are no repeating fields in a table & the fields are atomic
Tables in second normal form (2NF) ______ . Select the correct answer to fill in the gap. A) Have a composite key. B) Have all non key fields depend on the whole primary key. C) Have all non key fields depend part of the primary key. D) Have no dependencies between non key fields and the primary key.
B) Have all non key fields depend on the whole primary key
Third Normal Form is designed to ensure that _____. Select the correct answer to fill in the gap. A) A table that is in second normal form is decomposed into two or more tables. B) There are no dependencies between non-key fields. C) There are no dependencies between keys and non keys fields. D) Ensure that the database contains three tables.
B) There are no dependencies between non-key fields.
A kind of Yelp but for mechanics only: Suppose you are in charge of a community website that helps people find auto mechanics in their area. Users may post ratings and reviews of auto mechanics but they need to register first. You want to design a database for this website with the following features: Each registered user has a unique user name, a first name, last name, address information and e-mail address; however, your public website displays only the user name. For each mechanic, you want to store the name, address, phone number, and website URL. Each review is posted by a single user about a single mechanic, and consists of a service quality rating on a scale of 1 to 5, service cost, and comments. Each user may review many mechanics, but is only allowed to make one review per mechanic. Question: Suppose you created a table USER and a table REVIEW to store the respective information. What is the relationship between them, and how do you create it? A) USER M---<>--- 1 REVIEW, and the foreign key goes in REVIEW USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone, ReviewID) ReviewID foreign key to REVIEW REVIEW (ReviewID,ServiceRating, ServiceCost, Comments) B) USER 1 ---<>--- 1 REVIEW, and the foreign key goes in REVIEW and in USER USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone, ReviewID) ReviewID foreign key to REVIEW REVIEW (ReviewID,ServiceRating, ServiceCost, Comments, User) User foreign key to USER C) USER 1 ---<>--- M REVIEW, and the foreign key goes in USER: USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone, ReviewID) ReviewID foreign key to REVIEW REVIEW (ReviewID,ServiceRating, ServiceCost, Comments) D) USER 1 ---<>---M REVIEW, and the foreign key goes in REVIEW: USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone) REVIEW (ReviewID,ServiceRating, ServiceCost, Comments, User) User foreign key to USER
D) USER 1 ---<>---M REVIEW, and the foreign key goes in REVIEW: USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone) REVIEW (ReviewID,ServiceRating, ServiceCost, Comments, User) User foreign key to USER
A kind of Yelp but for mechanics only: Suppose you are in charge of a community website that helps people find auto mechanics in their area. Users may post ratings and reviews of auto mechanics but they need to register first. You want to design a database for this website with the following features: Each registered user has a unique user name, a first name, last name, address information and e-mail address; however, your public website displays only the user name. For each mechanic, you want to store the name, address, phone number, and website URL. Each review is posted by a single user about a single mechanic, and consists of a service quality rating on a scale of 1 to 5, service cost, and comments. Each user may review many mechanics, but is only allowed to make one review per mechanic. Question: Consider the table USER: USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone) Table USER does not have a primary key yet. What could be a primary key for USER? A) the field ServiceRating B) the field UserName C) the field Phone D) neither would work, we need to create a UserID
B) the field UserName
A kind of Yelp but for mechanics only: Suppose you are in charge of a community website that helps people find auto mechanics in their area. Users may post ratings and reviews of auto mechanics but they need to register first. You want to design a database for this website with the following features: Each registered user has a unique user name, a first name, last name, address information and e-mail address; however, your public website displays only the user name. For each mechanic, you want to store the name, address, phone number, and website URL. Each review is posted by a single user about a single mechanic, and consists of a service quality rating on a scale of 1 to 5, service cost, and comments. Each user may review many mechanics, but is only allowed to make one review per mechanic. Question: Suppose you have the following design so far. How do you "connect" table MECHANIC to the rest of the database? A) I create the relationship: MECHANIC 1 --<>-- M REVIEW B) I create the relationship: MECHANIC M --<>-- M USER C) I create the relationship: MECHANIC 1 --<>-- M REVIEW D) Need to create both relationships in A and C
C) I create the relationship: MECHANIC 1 --<>-- M REVIEW
Suppose you are in charge of a community website that helps people find auto mechanics in their area. Users may post ratings and reviews of auto mechanics but they need to register first. You want to design a database for this website with the following features: Each registered user has a unique user name, a first name, last name, address information and e-mail address; however, your public website displays only the user name. For each mechanic, you want to store the name, address, phone number, and website URL. Each review is posted by a single user about a single mechanic, and consists of a service quality rating on a scale of 1 to 5, service cost, and comments. Each user may review many mechanics, but is only allowed to make one review per mechanic. Question: How many tables do you need to design a DB for this situation? A) Two tables: USER and REVIEW B) Two tables: MECHANIC and USER C) Three: MECHANIC, USER, and REVIEW D) Four: MECHANIC, USER, REVIEW, and WEBSITE
C) Three: MECHANIC, USER, and REVIEW
a foreign key is A) a field in a table that has the same name as a primary key in another table B) a primary key that consists of more than one field C) a field in a table that matches a primary key of another table D) a field that could be an alternative primary key
C) a field in a table that matches a primary key of another table
A case competitions database:You work for a firm that has decided to sponsor case competitions between teams of college business students, and you were put in charge of creating a database to keep the corresponding data. The firm plans to hold about dozens of different regional competitions at various dates that will take place at different branches around the country. For each competition, you need to store a name, date, and the name of the branch where it is going to take place. For each college that has agreed to participate in the competition, you need to store the college name, a contact phone number, and a contact address. Each college can participate in only one competition, and the database should know which competition each college is participating in. On the other hand, each college is allowed to send more than one team to its competition. Each team gives itself a name and a color, and consists of several students of the same college; for each student, you want to store a first name, last name, date of birth, major, and expected graduation date. Question: How many tables do you need? A) two: COLLEGE & STUDENTS B) 3: COLLEGE, TEAM & STUDENT C) 3) COMPETITION, COLLEGE, & TEAM D) 4: COMPETITION, COLLEGE, STUDENT, & TEAM
D) 4: COMPETITION, COLLEGE, STUDENT, & TEAM
referential integrity is a database principle that declares that A) the foreign key cannot be empty B) no primary key can be composite C) the foreign key must be composed of one field only D) the foreign key value must be equal to a primary key value in the table it refers to
D) the foreign key value must be equal to a primary key value in the table it refers to
A kind of Yelp but for mechanics only: Suppose you are in charge of a community website that helps people find auto mechanics in their area. Users may post ratings and reviews of auto mechanics but they need to register first. You want to design a database for this website with the following features: Each registered user has a unique user name, a first name, last name, address information and e-mail address; however, your public website displays only the user name. For each mechanic, you want to store the name, address, phone number, and website URL. Each review is posted by a single user about a single mechanic, and consists of a service quality rating on a scale of 1 to 5, service cost, and comments. Each user may review many mechanics, but is only allowed to make one review per mechanic. Question: consider the following design... [USER] 1 --<>-- M [REVIEW] M --<>-- 1 [MECHANIC] USER (UserName, FirstName, LastName, Address, City, State, Zip, Email, Phone) MECHANIC (MechanicID, Name, Address, City, State, Zip, Phone, Website) REVIEW (ReviewID, ServiceRating, ServiceCost, Comments, UserName, MechanicID) UserName foreign key to USER MechanicID foreign key to MECHANIC A) no, you can't have 2 foreign keys in the same table B) no, there is a relationship missing C) no, the relasionship MECHANIC 1 --<>-- M REVIEW is incorrect D) yes
D) yes
