midterm1_4pm_f21.2

pdf

School

University of Washington *

*We aren’t endorsed by this school

Course

122

Subject

Mechanical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

17

Uploaded by MasterWasp3964

Report
0ν32 Questions Answered Middeb] 1 ͔4 PM͕ D1 Preliminaries 1 Point The allowed time for the exam is 50 ]X^edSc ͥ Be sure to pay attention to time and to budget your time accordinglyͫ The exam is open preΌprepared hardcopy 2Όsided cheat sheet but closed everything elseͥ You are not allowed to communicate with or otherwise interact with other students (or friends͕ during the course of the examͨ and this includes your HW brainstorming buddyͥ This exam is to be a solo effortͫ While taking the examͨ the only window open on your computer should be a browser with one tab Ό this oneͥ (Go ahead and close everything else now if you have not already done so͕ͥ Read each question carefullyͨ in its entiretyͨ and then answer each part of the questionͥ If you donͻt understand somethingͨ please just make your best educated guess and proceed accordinglyͥ AckkltledgemekqҾ I certify that I am taking this exam myselfͨ on my ownͨ with honesty and integrityͨ without interaction with others during the examͨ following FGHDENG NAME Search students by name or emailͦ Ë
the rules outlined on Piazza and aboveͨ and without having obtained any information about the examͻs content from any source prior to taking itͥ Save Answer D2 To EΌR is Human 33 Points Based only on the EΌR model pictured belowͨ examine the model carefully and indicate whether each of the following statements are True or Falseͥ (This EΌR diagram will be repeated every five questions or so for your convenience͕ͥ D2ͥ1 2 Points A cartoon may have a weaponͥ Save Answer True ý False ý True ý False ý
D2ͥ2 2 Points A film will have either zero or one genres (eͥgͥͨ mysteryͨ comedyͨ actionͨ or ͕ͥͥͥͥ Save Answer D2ͥ3 2 Points Two different production companies (ProductionCoͻs͕ may have the same name but different addressesͥ Save Answer D2ͥ4 2 Points An actor cannot star in several roles in a given filmͥ Save Answer D2ͥ5 2 Points Every murder mystery has a known title and yearͥ True ý False ý True ý False ý True ý False ý
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Save Answer D2ͥ6 2 Points Being an actor requires starring in at least one filmͥ Save Answer D2ͥ7 2 Points A murder mystery can be coΌowned by several production companiesͥ Save Answer True ý False ý True ý False ý True ý False ý
D2ͥ8 2 Points An actor may have a starring role in a cartoon without providing a voice for that cartoonͥ Save Answer D2ͥ9 2 Points A crew can be uniquely identified by just specifying its crew numberͥ Save Answer D2ͥ10 2 Points A cartoon can have an associated genre (eͥgͥͨ comedy͕ͥ Save Answer D2ͥ11 2 Points True ý False ý True ý False ý True ý False ý
The number of stars in a given film is computable from other information directly stored in the film entityͥ Save Answer D2ͥ12 2 Points Every film involves the use of at least one crewͥ Save Answer D2ͥ13 2 Points Every film must have a production company that owns itͥ True ý False ý True ý False ý
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Save Answer D2ͥ14 2 Points Every production company must own one or more filmsͥ Save Answer D2ͥ15 2 Points Two crews that work for a given production company may have different headsͥ The next few questions indicate a new constraint that we might wish to change or enforce on the given schemaͥ For each oneͨ indicate whether or not the EΌR modeling concepts and tools that we have covered in class and used in the homework can capture the given constraint by modifying the current schema in some wayͥ Save Answer D2ͥ16 1 Point True ý False ý True ý False ý True ý False ý
A cartoon cannot be a murder mysteryͥ Save Answer D2ͥ17 1 Point A given film can have no more than three starsͥ Save Answer D2ͥ18 1 Point An actor can appear in multiple roles in the same filmͥ EΌRΌmodelΌable ý not EΌRΌmodelΌable ý EΌRΌmodelΌable ý not EΌRΌmodelΌable ý
Save Answer D3 To EΌR ΌΌϊ R is Divine 33 Points Consider again the earlier EΌR model (repeated again below for your convenience͕ͥ For this questionͨ your job is to translate this EΌR model into an appropriate relational schema that can capture as many of the modelͻs features and constraints as possibleͥ Use the deltaΌtable approach for the film hierarchy aspect of the modelͥ Be sure to include ON DELETE clauses for all of your FOREIGN KEYsͥ Use table and column names that correspond to the EΌR diagramͻs artifact names wherever possibleͨ and use good naming conventions otherwiseͥ You may introduce additional tables where needed to fully capture the modelͥ Also answer each of the questions that follow about the overall relational mapping for this EΌR schemaͥ D3ͥ1 19 Points Write a complete SQL CREATE TABLE DDL statement (or statementsͨ if any supporting tables are needed͕ to model the Film entityͥ While doing soͧ Use your best judgement when choosing the data type for each columnͥ You can omit the attribute numstars (rather than defining a view͕ for this exerciseͥ Your answer mrpq include any relationshipΌmerging needed to avoid having more tables than whatͻs really necessary for this schema overallͥ Films are central to this databaseͨ so you should make sure thatͨ as production companies come and goͨ films will first have to be transferred to some other production company (and cannot be accidentally removed͕ͥ EΌRΌmodelΌable ý not EΌRΌmodelΌable ý
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Put your DDL statement(s͕ in the box belowͥ Enter your answer here Save Answer D3ͥ2 5 Points Now write the complete SQL CREATE TABLE DDL statement to model the Cartoon entityͥ Enter your answer here Save Answer D3ͥ3 3 Points
In addition to what the given schema saysͨ you have just gotten a lateΌbreaking update (in a text message from your boss͕ͫ that says ͺPlease make sure that no two films in a given year can have the same titleͫͺ What additional line would you need to add to the film table definition in question 3ͥ1 in order to keep your boss happyͰ Enter your answer here Save Answer D3ͥ4 2 Points How many tables will you need in total for a relationshipΌoptimizedͨ deltaΌtable based relational schema that captures the entire given EΌR modelͰ Save Answer D3ͥ5 2 Points The primary keys for ProductionCo and Actor will be fields called name (and of type text͕ͨ and you have already figured out what the primary keys should be for most of the other tablesͥ But what about CrewͥͥͥͰ What should the PRIMARY KEY clause in the Crew CREATE TABLE statement beͰ Enter your answer here Save Answer 6 ý 7 ý 8 ý 9 ý 10 ý 11 ý
D3ͥ6 2 Points Consider an instance of the movie database in which the Film delta table has F rows and the MurderMystery delta table has M rowsͥ Which of the following inequalities is a correct description of the relationshipͨ one that holds in general (for all possible database instances͕ͨ between F and MͰ Save Answer D4 Relational DB Design Theory 33 Points Consider an instance of a relation E with the following contentsͧ D4ͥ1 5 Points Which of the following are possible FDsͨ based on what you can tell from E ͻs current contentsͰ F ϋ M ý F ϊϋ M ý F ωϋ M ý
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Save Answer D4ͥ2 5 Points Which of the possible FDs from above can be inferred to be true from E ͻs current contentsͰ Save Answer D4ͥ3 9 Points snm Όϊ szp snm Όϊ fid anm Όϊ aph fyr Όϊ fti fid Όϊ fti snm Όϊ szp snm Όϊ fid anm Όϊ aph fyr Όϊ fti fid Όϊ ft None of the above
One of your predecessors in your new jobͨ who recently left the companyͨ had time to document the schema of R and to get its list of functional dependencies by interviewing the application stakeholders for this databaseͥ Unfortunatelyͨ they left before they normalized E ͥ Here are the functional dependencies that they left youͧ snm Όϊ sst snm Όϊ szp fid Όϊ ftiͨ fyr fidͨ anm Όϊ rol anm Όϊ aph fid Όϊ snm What attributes are in the attribute closure of attribute fidͰ Save Answer D4ͥ4 5 Points Which of the following are among the candidate keys for E Ͱ snm sst szp fid fti fyr rol anm aph
Save Answer D4ͥ5 3 Points Given its FDsͨ which of the following issues is keeping the initial relation E from being in a better normal formͰ Save Answer D4ͥ6 3 Points As a reminderͨ the initial set of dependencies that you were given for the relation E (snmͨ sstͨ szpͨ fidͨ ftiͨ fyrͨ rolͨ anmͨ aph͕ wasͧ snm Όϊ sst snm Όϊ szp fid Όϊ ftiͨ fyr fidͨ anm Όϊ rol (snmͨ fid͕ (snmͨ fidͨ anm͕ (fidͨ anm͕ (fidͨ anmͨ rol͕ fid It has trivial dependencies ý It has partial dependencies ý It has transitive dependencies ý It has overlapping candidate keys ý
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
anm Όϊ aph fid Όϊ snm What is the highest normal form that the initial relation E satisfiesͰ Save Answer D4ͥ7 3 Points You just received a text message from an unknown number suggesting that E should be decomposed as followsͧ R1 (fidͨ ftiͨ fyrͨ snm͕ R2 (snmͨ sstͨ szp͕ R3 (anmͨ aph͕ Which of the following statements are true of the proposed decompositionͰ Save Answer Save All Answers Submit & View Submission \ 1NF ý 2NF ý 3NF ý BCNF ý It is a decomposition of E It is a losslessΌjoin decomposition of E It is a dependencyΌpreserving decomposition of E None of the above