Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. (total marks 20) Given the same simple SalesRep-Worksin-SalesArea database schema you worked on in assignment 1, which contains three files described as follows: SalesRep
1. (total marks 20) Given the same simple SalesRep-Worksin-SalesArea database schema you worked on in assignment 1, which contains three files described as follows: SalesRep (SRid: integer, SRname: string, SRage: integer, salary: real) Worksin (SRid: integer, Arid: integer, hours: integer) SalesArea (Arid: integer, Aname: string, city: string, budget: real, managerid: integer) Note : SRid, SRname, SRage salary are the sales rep id, name, age and salary respectively. Also, hours is the number of hours worked by sales rep in the sales area. The rest of the attributes Arid, Aname, city, budget and managerid are the area id, name, location, budget and managerid respectively. A manager is a sales rep. Assume that an update operation (a general term in this chapter, for an insert a modify or a delete operation) is to be made to this database to enter information about a new Salesrep who is now the new manager of an existing SalesArea (replacing the old manager) and although he is new, he has worked some hours in another existing SalesArea. Answer the following questions on what specific relations, attributes and operations (eg. insert, modify, delete) that need to be done for this update to be implemented in the entire database. This is not SQL query yet. Provide your answers both in descriptive sentence and using the formal (not SQL) database operations of INSERT, MODIFY, DELETE as used in Chapter 5 of book with specific attributes and relations when possible. An example formal insert of a Salesrep record into the Salesrep table is: INSERT SRidr, SRname, Srage, salary> into SalesRep // for new SalesRep record And an example descriptive sentence of the formal operation above is: do an insert operation for a new SalesRep record into the SalesRep table. (a) Give the set of needed insert, modify or delete operations for this update. (6) What types of constraints (explain with data) would you expect to check for this update to be done? 5 marks (c) Which of the constraints of key, entity integrity, and referential integrity constraints are checked by each of your operations (e.g., Insert) and which are not? 5 marks (d) Specify all the referential integrity (foreign key) constraints on this database. 5 marks 5 marks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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