Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following scenario: A company has a number of customers who have addresses and phone numbers, and we assume that while there may
Consider the following scenario: A company has a number of customers who have addresses and phone numbers, and we assume that while there may be multiple customers with the same address, no two customers with the same name have the same address or the same phone number. Each customer has a customer id, which is unique to that customer. Suppose that this information is stored as a relational database relation or table. Answer the following: a. What is the schema for this relation (the attributes or columns and their domains or types)? b. What are possible superkeys for this relation? C. Which of the superkeys identified above are the candidate keys for the relation? d. What is the best choice from the candidate keys for the primary key of the relation? 2. Consider the previous scenario. Suppose now that the company wants to also build relations that describe its inventory and sales transactions. For the inventory, the store keeps track of the following: The product manufacturer name The product model number The number in stock The wholesale price The retail price A manufacturer has many products, each of which has a product number that is unique for that manufacturer. However, two manufacturers could have the same product numbers for some of their products. For the sales transactions, the company tracks the following The customer id of the customer making the sale The date of the sale The product purchased model number The product purchased manufacturer name The price paid including tax Assume that a customer makes only one order on any given day. Develop the schemas for each of the above relations, including primary keys and foreign keys, using only attributes representing the information described above. Note that for the sales transaction relation, you must develop foreign keys that refer to the customer table and the inventory table. 3. Consider the following set of tables describing students and school clubs: Student SID Name Gender Status GPA 100 Bill M Fr 3.3 101 John M So 2.1 102 Sue F Jr 3.2 103 Mary F Sr 3.6 105 Jane F Fr 2.9 Clubs CID 1 2 Name MtgRm Chess 144 Debate 145 ClubMemberships SID 100 200 300 300 400 (3,200) CID 1 I 1 2 2 a. Assuming that SID and CID are unique identifiers, what are likely primary keys for the Student and Clubs tables? b. What is the primary key for the ClubMemberships table? c. What are foreign keys necessary for this set of tables in order to ensure that only registered students can be in clubs and students can only join registered clubs? 4. Can you add the following tuple to the ClubMemberships table based on your foreign keys? Why or why not? 5. Can you add the following tuple to the ClubMemberships table based on your foreign keys? (1, 101) Why or why not? 6. Consider the following scenario from your textbook on page 118 dealing with a chain of hotels that need to manage the bookings of their guests into rooms at specific hotels in the chain. The hotel chain maintains four tables in order to manage this information: Hotel/hotelNo, hotelName, city) Room(roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest(guestNo. guestName, guestAddress, guestPhoneNo, guestEmail) The underlined attribute(s) of each relation form the primary key of the relation. a. Identify foreign key relations in the tables that will allow the appropriate referential integrity rules to be applied. For each foreign key relation, specify the referring table, the primary table, and the attributes that form the foreign key in the referring table. For example, a guest should not be booked into a non-existing room at a hotel. A guest should not be booked into a room unless there is information about the guest. Page 2 of 4 For the remaining questions, use the following set of relational database tables to the results for the relational algebra expressions. 7. Og
Step by Step Solution
★★★★★
3.44 Rating (147 Votes )
There are 3 Steps involved in it
Step: 1
PageNo01 Solution Given data Consider the Following sunario A company has a number of ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started