






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Mid term exam based on the Datascience and the data engineering
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!
Answer:
A weak relationship is a relationship in which the primary keys of the related entities are independent of each other.
A strong relationship is a relationship in which a primary key of one table is part of primary key of the other table.
Grading Rubric : Definition must contain primary key relation mentioned in the actual answer.
Answer:
Grading Rubric : Each of the entities must have some attributes.
In Manager part of the problem, it’s essential to have a recursive relationship between employee and department.
No specialization hierarchy required. Any assumptions must be stated in the solution.
Answer: Left outer join would include remaining (unmatched) rows from the table on the left and fill values of columns on the right with nulls for those rows. Right outer join would include the opposite: unmatched row from the table on the right and fill out values on the left with nulls.
Grading Rubric: 1 mark has been deducted if you didn't specify that there will be null or empty values in the rows which don't match in left/ right outer join. Specifying about the NULL values in unmatched rows is the requirement of the answer. Points has been awarded if ‘null’ values are mentioned in the d) part of the question or shown in the example.
Answer: Left outer join would include vendors who haven’t sold any products, right outer join would include products that aren’t sold by vendor (in addition to vendor list and the products each vendor is selling).
Grading Rubric: Points has been given if the explanation is correct OR the difference is shown through the means of tables or examples. -1 if you didn't specify what data from both tables will be included in the respective join table and just defined what left and right outer joins will do on both tables. The answer should give the sense that Left outer join would include vendors who haven’t sold any products, right outer join would include products that aren’t sold by vendor (in addition to vendor list and the products each vendor is selling) else 1 mark has been deducted.
ID Brand Name State Type Price Rate Comm Pref Info 29001 Hershey Reese's PA Confection 1.29 3 Good peanut butter!
Bar Michael Mast 29001 Hershey NutRageous PA Bar 1.39 4 Packaging isn’t great
Bar Michael Mast 29001 Hershey Pieces PA Candy 0.99 2 Worst candy ever
Bar Michael Mast
29001 Hershey York PA Confection 0.99 3 Too sweet Bar Michael Mast 29001 Mars Snickers WA Bar 1.45 3 Not a fan of almonds
Bar Michael Mast 29001 Mars Twix WA Bar 1.45 5 Best product ever
Bar Michael Mast 29001 Mars M&M WA Candy 1.79 3 The coating is too hard
Bar Michael Mast
1202 Hershey York PA Confection 0.99 3 Just a failed cop of PBCs
Candy Paul Bulcke 1202 Hershey Snack Barz PA Bar 0.89 3 Too hard Candy Paul Bulcke 1202 Mars 3Musketeers WA Bar 1.69 2 Best quality Candy Paul Bulcke 1202 Mars Bounty WA Bar 1.55 3 Too much coconut
Candy Paul Bulcke
1202 Mars Twix WA Bar 1.45 3 Too much nuts
Candy Paul Bulcke 1202 Mars M&M WA Candy 1.79 5 The best taste ever
Candy Paul Bulcke
0 points: Neither 3NF nor 2NF are correct.
Answer : Atomicity, all parts of each transaction must complete or the transaction needs to be rolled back.
Transfer from checking to savings contains 4 parts: start, update to balance on checking, update to balance on savings, and commit.
Grading Rubric: 1 mark for "Atomicity" 0 for "Availability"/other/no answer. 1 mark for " All or none", "rollback if interrupted" 0 for No answer or explained deduction in comment.
Answer : Logs are read from bottom up.
Grading Rubric : 1 for correct balance =525.75 AND correct quantity=25, 1 for correct order of recovery i.e. first balance is recovered then quantity. 0 otherwise. No Partial Marking.
Answer: Lists all Viterbi Computer Science students who have taken CS 585.
Grading Rubric: 1 mark for correct explanation. No partial points.
Answer: SELECT id, name FROM viterbi_Students WHERE courseTaken = ‘CS 585’ AND branch = ‘Computer Science’;
Assuming the number of students taking CS 585 would be much lesser than the number of students who are enrolled in Computer Science. For AND we should write the condition that is more likely to be false first.
Grading Rubric: 1 mark for correct query. 1 mark for correct explanation. No points for explanation if query is wrong. No points for solutions related to indexing.
Answer: Vertical fragmentation.
Project_id Budget
Project_id PName Location Manager
Grading Rubric:
1 point for vertical fragmentation (awarded point for explaining the definition exactly if the word is missing). 1 point for correct design as mentioned above.
Answer: Horizontal fragmentation. Each sub-table stores its state’s project records (rows).
Grading Rubric: 1 point for horizontal fragmentation (awarded point for explaining the definition exactly if word is missing)
Answer: Phase 1: Coordinator asks subordinates if ready to write to log (write ahead protocol), if yes: write, if no or fails: abort. Phase 2: Coordinator asks subordinates if ready to commit, if yes: commit, if no: abort, if fails: undo. DO-UNDO-REDO protocol rolls transactions back and forward with the help of the system’s transaction log entries.
Grading Rubric:
2 points: Correct explanation
0 points : For students who have written 2 phase locking protocol.
1 mark : If only DO-UNDO-REDO is mentioned with relevant explanation.