sample-final-b
.pdf
keyboard_arrow_up
School
University of Alberta *
*We aren’t endorsed by this school
Course
291
Subject
Computer Science
Date
Feb 20, 2024
Type
Pages
9
Uploaded by CorporalFoxPerson645
Family Name: ----------------------------------------------------- Given
Name: ----------------------------------------------------- Student ID (last 3 digits): -----------------------------------------------------
University of Alberta Faculty of Science Fall CMPUT 291 – A1 File Structures and Data Management Duration: 2 Hours Aids Allowed: a one-page cheat sheet only.
Your examination booklet must have 9 pages
(including this page).
QUESTION VALUE SCORE 1 9 2 16 3 4 4 4 5 12 6 7 8 8 6 13 TOTAL 72 © Davood Rafiei
2023
CMPUT 291 / A1 Final Exam - Fall Page 2 of 9 Question 1 [ 9 marks in total ] TRUE or FALSE: 1.5 marks for each correct answer; 0 mark for each incorrect answer; 0.5 mark if no choice is selected. a)
In ER diagrams, a thick bold line from an entity set to a relationship set means every entity in the set must participate in the relationship. ( ) TRUE ( ) FALSE b)
In the relational model, every key is a super key but not vice versa. ( ) TRUE ( ) FALSE c)
Every relational algebra query can be expressed in relational calculus. ( ) TRUE ( ) FALSE d)
For any pair of relations R and S, . ( ) TRUE ( ) FALSE e)
Clustered indexes are generally more efficient than unclustered indexes for both searches and updates. ( ) TRUE ( ) FALSE f)
The seek time is the time it takes to search through an index for a key. ( ) TRUE ( ) FALSE Question 2 [ 16 marks in total ] Consider the following tables with the primary key of each table underlined, and a few sample tuples shown. The columns cid
and rid
in bookings
are foreign keys referencing customers
and resorts
respectively. ((
R
▹◃
S
)
▹◃
R
)
▹◃
S
=
R
▹◃
S
cid name city country age c10 Davood Edmonton Canada 20 c20 John Victoria Canada 65 cid rid arrival departure c10 r300 2021/12/17 2021/12/27 c20 r200 2021/12/24 2022/01/03 bookings customers
CMPUT 291 / A1 Final Exam - Fall Page 3 of 9 Express the following queries in SQL. In each case, write a single SQL statement. a)
[4 marks]
Find the name and the city of customers who have booked a resort in Mexico. b)
[4 marks] Find the rid of resorts with at least 80% of their bookings made by customers from Canada. c)
[4 marks] Find the names of all pairs of different customers from Edmonton such that both customers stay in the same resort and the days of their stays overlap. rid resort city country suites r200 Andaz Guanacaste
Costa Rica 80 r300 Dreams Sands Cancun Mexico 60 resorts
CMPUT 291 / A1 Final Exam - Fall Page 4 of 9 d)
[4 marks] For each country and city that has a resort, list the country and the city, the number of resorts and the number of resorts with a customer booking from Canada. Question 3 [ 4 marks ] Based on the schema in Question 2, write a relational algebra or a relational calculus query (but not both) to find the rid of resorts that have no booking for customers of age 30 or less. Question 4 [ 4 marks ] Based on the schema in Question 2, write a SQL assertion to enforce that no resort can have more bookings (ignoring the dates) than the number of suites in the resort.
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
Related Questions
------------------------------------------------book------------------------------------------------+ id+ title+ author+ isbn+ etc.------------------------------------------------
------------------------------------------------customer------------------------------------------------+ id+ first_name+ first_name+ email+ address+ city+ state+ zip+ etc.------------------------------------------------
------------------------------------------------book_copy------------------------------------------------+ id+ book_id (FK to book)+ customer_id (FK to customer)+ checked_out+ due_date+ etc.----------------------------------
use the information above to:
With the aid of Microsoft SSMS (SQL Server Management Studio), create both database schema and insert 10 records into each relation for each database.
Specify primary keys
Specify foreign keys
All sample SQL statements must be submitted.
arrow_forward
Explain what the following does.
-------------------------------------------------------------------------------------------------------------------
Get-History | Where-Object {$_.CommandLine -like 'Get-EventLog*'} | select -Unique | select -Property id | ForEach-Object {Invoke-History $_.Id}.
arrow_forward
sniffy lab
arrow_forward
Computational Approaches to studying or mitigating of tuberculios
please list the steps and a relaible source for your answer
arrow_forward
Explain the application of DSP in Biomedical field
arrow_forward
Information about gore tex
arrow_forward
Describe the operation of Google Dorks and its original purpose.
arrow_forward
Nfa to dfa
arrow_forward
Define biometric device
arrow_forward
Troubleshooting in Daily Life
Troubleshooting is a technical term for solving a problem. Chances are you have already done some troubleshooting in your daily life.
What are some examples of troubleshooting that you have experienced? What were you trying to fix and why? When you were doing it, did you think of it as "troubleshooting" or not? If you did the same activity today, would you think of it as "troubleshooting" now? Could you provide documentation for someone else who may have had the same issue so they could resolve it? How would you do that? What would you include?
arrow_forward
whathedifferencebetween Kamandkom
deluxe
arrow_forward
SOLUTION TO BELOW PROBLEM NEEDED URGENTLY PLEASE.
-------------------------------------------------------------------------
Classic Store is a book store downtown that has been selling books in the town for a very long time and is quite known in the neighborhood. They have recently moved to digitalize their records onto the system. They need to add all the book details into the new system. Help the authorities to collect the book details and to display them using C++ programming. Use the concept of Constructors to create Book objects. Store the book details in an array and display the array in a table format.Write a C++ program to store the book details in an array as an array of Book objects and display them using constructors.
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.
A class named Book has the following private data member…
arrow_forward
ASDFA
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Enhanced Discovering Computers 2017 (Shelly Cashm...
Computer Science
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Related Questions
- ------------------------------------------------book------------------------------------------------+ id+ title+ author+ isbn+ etc.------------------------------------------------ ------------------------------------------------customer------------------------------------------------+ id+ first_name+ first_name+ email+ address+ city+ state+ zip+ etc.------------------------------------------------ ------------------------------------------------book_copy------------------------------------------------+ id+ book_id (FK to book)+ customer_id (FK to customer)+ checked_out+ due_date+ etc.---------------------------------- use the information above to: With the aid of Microsoft SSMS (SQL Server Management Studio), create both database schema and insert 10 records into each relation for each database. Specify primary keys Specify foreign keys All sample SQL statements must be submitted.arrow_forwardExplain what the following does. ------------------------------------------------------------------------------------------------------------------- Get-History | Where-Object {$_.CommandLine -like 'Get-EventLog*'} | select -Unique | select -Property id | ForEach-Object {Invoke-History $_.Id}.arrow_forwardsniffy labarrow_forward
- Troubleshooting in Daily Life Troubleshooting is a technical term for solving a problem. Chances are you have already done some troubleshooting in your daily life. What are some examples of troubleshooting that you have experienced? What were you trying to fix and why? When you were doing it, did you think of it as "troubleshooting" or not? If you did the same activity today, would you think of it as "troubleshooting" now? Could you provide documentation for someone else who may have had the same issue so they could resolve it? How would you do that? What would you include?arrow_forwardwhathedifferencebetween Kamandkom deluxearrow_forwardSOLUTION TO BELOW PROBLEM NEEDED URGENTLY PLEASE. ------------------------------------------------------------------------- Classic Store is a book store downtown that has been selling books in the town for a very long time and is quite known in the neighborhood. They have recently moved to digitalize their records onto the system. They need to add all the book details into the new system. Help the authorities to collect the book details and to display them using C++ programming. Use the concept of Constructors to create Book objects. Store the book details in an array and display the array in a table format.Write a C++ program to store the book details in an array as an array of Book objects and display them using constructors. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. A class named Book has the following private data member…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Enhanced Discovering Computers 2017 (Shelly Cashm...Computer ScienceISBN:9781305657458Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. CampbellPublisher:Cengage LearningSystems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage Learning
Enhanced Discovering Computers 2017 (Shelly Cashm...
Computer Science
ISBN:9781305657458
Author:Misty E. Vermaat, Susan L. Sebok, Steven M. Freund, Mark Frydenberg, Jennifer T. Campbell
Publisher:Cengage Learning
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning