Refer to the entity-relation scheme this assignment to test the queries. Use the file DreamHome.db included...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Refer to the entity-relation scheme this assignment to test the queries. Use the file DreamHome.db included in Answer the following questions using SQL to produce the view. Only the SQL query will attract marks, not the view. Also, you must include at the end of your query the primary and foreign keys (if any) used. Degree and cardinality of the resulting view, and one sentence explaining the content of the first tuple based on the attributes queried. a) Find the total number of Managers and the sum of their salaries. (5 marks) b) Find the minimum, maximum, and average staff salary. [5 marks] c) For each branch office with more than one member of staff, find the number of staff working in each branch and the sum of their salaries. [5 marks] d) Construct a list of all cities where there is either a branch office or a property. [5 marks] e) Construct a list of all cities where there is both a branch office and a property. [5 marks] Refer to the entity-relation scheme this assignment to test the queries. Use the file DreamHome.db included in Answer the following questions using SQL to produce the view. Only the SQL query will attract marks, not the view. Also, you must include at the end of your query the primary and foreign keys (if any) used. Degree and cardinality of the resulting view, and one sentence explaining the content of the first tuple based on the attributes queried. a) List the details of all viewings on property PA14 where a comment has been supplied (note: you may need to use the clause NULL). [6 marks] b) Find the total number of Assistants, and the sum and average o their salaries [6 marks] c) For each branch office, list the staff numbers and names of staff who manage properties alongside the properties they manage. [6 marks] d) For each branch, you are asked to list the staff numbers and names of staff who manage properties, including the city in which the branch is located and the properties that the staff manage. Note: This a three-table query it is suggested to use an AND for the join. [7 marks]. Branch branchNo street B005 B007 003 B004 B002 PA14 PL94 PG4 22 Deer Rd 16 Argyll St 163 Main St 32 Manse Rd 56 Clover Dr Staff staffNo Name IName position sex DOB salary branchNo SL21 John White Manager M 1-Oct-45 30000 B005 SG37 Ann Beech 10-Nov-60 12000 B003 Assistant F Supervisor M 24-Mar-58 18000 B003 B007 19-Feb-70 9000 SG14 David Ford SA9 Mary Howe SG5 SL41 PropertyForRent property No street PG36 PG21 PG16 Client city London Aberdeen Glasgow Bristol London postcode SW1 4EH AB2 35U G11 9QX BS99 INZ NW10 6EU Assistant F Susan Brand Manager F Julie Lec Assistant F 16 Holhead Argyll St 6 6 Lawrence St 2 Manor Rd 18 Dale Rd S Novar Dr 3-Jun-40 24000 B003 13-Jun-65 9000 B005 city postcode type rooms rent ownerNo staffNo branch No Aberdeen AB7 5SU House 6 London NW2 Glasgow G119QX Glasgow G32 4QX Glasgow G12 Glasgow G12 9AX Flat Flat Flat House 6433 in 5 Flat 4 650 C046 400 CO87 350 CO40 375 CO93 600 CO87 450 C093 SA9 SLAI SG37 SG37 SG14 B007 B005 B003 B003 B003 B003 Activate PG16 5 Novar Dr Glasgow G12 9AX Client clientNo Name IName telNo CR76 John Kay 0207-774-5632 Flat CR56 Aline Stewart 0141-848-1825 Flat CR74 CR62 CO46 CO87 CO40 C093 Private Owner ownerNo Name IName address 425 350 Mike Ritchie 01475-392178 House 750 Mary Tregear 01224-196720 Flat 600 Joe Keogh Carol Farrel Tina Murphy Tony Shaw CR56 PA14 CR76 PG4 CR56 PG4 CR62 PA14 CR56 PG36 Flat 4 prefType maxRent eMail Viewing clientNo property No viewDate comment 24-May-13 too small 20-Apr-13 too remote 26-May-13 14-May-13 no dining room 28-Apr-13 450 C093 telNo 2 Fergus Dr, Aberdeen AB2 7SX 01224-861212 jkeogh@hh.com 6 Achray St. Glasgow G32 9DX 63 Well St. Glasgow G42 0141-357-7419 cfarrel@gmail.com 0141-943-1728 tinam@hotmail.com 0141-225-7025 tony.shaw@ark.com 12 Park Pl, Glasgow G4 0QR CR76 CR56 CR74 CR62 john.kay@gmail.com astewart@hotmail.com mritchie01@yahoo.co.uk maryt@hotmail.co.uk SG14 eMail B005 B003 B003 B007 B003 password ******** ******** Registration clientNo branchNo staffNo dateJoined ******** SL41 2-Jan-13 SG37 SG37 SA9 11-Apr-12 16-Nov-11 7-Mar-12 Refer to the entity-relation scheme this assignment to test the queries. Use the file DreamHome.db included in Answer the following questions using SQL to produce the view. Only the SQL query will attract marks, not the view. Also, you must include at the end of your query the primary and foreign keys (if any) used. Degree and cardinality of the resulting view, and one sentence explaining the content of the first tuple based on the attributes queried. a) Find the total number of Managers and the sum of their salaries. (5 marks) b) Find the minimum, maximum, and average staff salary. [5 marks] c) For each branch office with more than one member of staff, find the number of staff working in each branch and the sum of their salaries. [5 marks] d) Construct a list of all cities where there is either a branch office or a property. [5 marks] e) Construct a list of all cities where there is both a branch office and a property. [5 marks] Refer to the entity-relation scheme this assignment to test the queries. Use the file DreamHome.db included in Answer the following questions using SQL to produce the view. Only the SQL query will attract marks, not the view. Also, you must include at the end of your query the primary and foreign keys (if any) used. Degree and cardinality of the resulting view, and one sentence explaining the content of the first tuple based on the attributes queried. a) List the details of all viewings on property PA14 where a comment has been supplied (note: you may need to use the clause NULL). [6 marks] b) Find the total number of Assistants, and the sum and average o their salaries [6 marks] c) For each branch office, list the staff numbers and names of staff who manage properties alongside the properties they manage. [6 marks] d) For each branch, you are asked to list the staff numbers and names of staff who manage properties, including the city in which the branch is located and the properties that the staff manage. Note: This a three-table query it is suggested to use an AND for the join. [7 marks]. Branch branchNo street B005 B007 003 B004 B002 PA14 PL94 PG4 22 Deer Rd 16 Argyll St 163 Main St 32 Manse Rd 56 Clover Dr Staff staffNo Name IName position sex DOB salary branchNo SL21 John White Manager M 1-Oct-45 30000 B005 SG37 Ann Beech 10-Nov-60 12000 B003 Assistant F Supervisor M 24-Mar-58 18000 B003 B007 19-Feb-70 9000 SG14 David Ford SA9 Mary Howe SG5 SL41 PropertyForRent property No street PG36 PG21 PG16 Client city London Aberdeen Glasgow Bristol London postcode SW1 4EH AB2 35U G11 9QX BS99 INZ NW10 6EU Assistant F Susan Brand Manager F Julie Lec Assistant F 16 Holhead Argyll St 6 6 Lawrence St 2 Manor Rd 18 Dale Rd S Novar Dr 3-Jun-40 24000 B003 13-Jun-65 9000 B005 city postcode type rooms rent ownerNo staffNo branch No Aberdeen AB7 5SU House 6 London NW2 Glasgow G119QX Glasgow G32 4QX Glasgow G12 Glasgow G12 9AX Flat Flat Flat House 6433 in 5 Flat 4 650 C046 400 CO87 350 CO40 375 CO93 600 CO87 450 C093 SA9 SLAI SG37 SG37 SG14 B007 B005 B003 B003 B003 B003 Activate PG16 5 Novar Dr Glasgow G12 9AX Client clientNo Name IName telNo CR76 John Kay 0207-774-5632 Flat CR56 Aline Stewart 0141-848-1825 Flat CR74 CR62 CO46 CO87 CO40 C093 Private Owner ownerNo Name IName address 425 350 Mike Ritchie 01475-392178 House 750 Mary Tregear 01224-196720 Flat 600 Joe Keogh Carol Farrel Tina Murphy Tony Shaw CR56 PA14 CR76 PG4 CR56 PG4 CR62 PA14 CR56 PG36 Flat 4 prefType maxRent eMail Viewing clientNo property No viewDate comment 24-May-13 too small 20-Apr-13 too remote 26-May-13 14-May-13 no dining room 28-Apr-13 450 C093 telNo 2 Fergus Dr, Aberdeen AB2 7SX 01224-861212 jkeogh@hh.com 6 Achray St. Glasgow G32 9DX 63 Well St. Glasgow G42 0141-357-7419 cfarrel@gmail.com 0141-943-1728 tinam@hotmail.com 0141-225-7025 tony.shaw@ark.com 12 Park Pl, Glasgow G4 0QR CR76 CR56 CR74 CR62 john.kay@gmail.com astewart@hotmail.com mritchie01@yahoo.co.uk maryt@hotmail.co.uk SG14 eMail B005 B003 B003 B007 B003 password ******** ******** Registration clientNo branchNo staffNo dateJoined ******** SL41 2-Jan-13 SG37 SG37 SA9 11-Apr-12 16-Nov-11 7-Mar-12
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
What steps must the suppliers of Wireless Devices must follow. How could you insure the wireless devices that you intend to use in your design meets the ACMA regulations:
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Choose an organization in the community to study (church, restaurant, retail, museum...etc). Interview leaders and team members. 1) What elements of a management system do they have in the...
-
Discuss the interface between Purchasing and Supply Management and Logistics Management specifically with respect to selection of a third party logistics provider, analysis of the total cost of...
-
What is a telecommunications protocol?
-
Maritime Distributors created a $500 imprest petty cash fund. During the first month of use, the fund custodian authorized and signed petty cash tickets as shown below. Required Make general journal...
-
Examination of Fig. 6.5 shows that a relatively abrupt threshold in values of \(\tilde{\lambda}_{n}\) occurs as \(n\) is varied. In particular, as a rough approximation, \[ \tilde{\lambda}_{n}...
-
The Kurten Corporation is authorized to issue $500,000 of 8% bonds. Interest on the bonds is payable semiannually; the bonds are dated January 1, 2007 and are due December 31, 2012. Required Prepare...
-
A ball is thrown vertically, from a height h=24.7m, with velocity vi. It lands on the ground after a time interval t. Coordinate axes are indicated in the figure. Assume that air resistance is...
-
In June 2017, BMW announced plans to spend $600 million to expand production at its South Carolina plant. The new investment would allow BMW to prepare for new X model SUVs. BMW apparently felt it...
-
What is eminent domain? What are the main legal issues involved in an eminent domain proceeding?
-
a. You are given the following data for Bond Ace and Bond Diamond. Both bonds have a face value of RM100 each. ii. iii. iv. Item Price Coupon Yield to Maturity Years to Maturity Rating Required: i....
-
Businesses contribute intensely to achieving the fundamental goals to any national economy, becoming the back bone of social-economical progress - Peter Drucker, 2009. The SME sector plays an...
-
Consider a plant that satisfies the following requirements and find the transfer function of the plant. The plant have two poles and one zero. The gain of the plant is two. The maximum overshoot is...
-
An investor is holding 1,000 shares of Limited Company. Presently the rate of dividend being paid by company is 2 per share and the share is being sold at 25 per share in the market. However, several...
-
Prudence solves the rational equation (-7x-20)/((x+2)(x+4))+2=(x)/(x+4) and obtains the solutions x=1 and x=-4. What are some correct possible comments her math instructor would say about her...
-
Which of the following statements is FALSE about interest rates? A. As interest rates may be quoted for different time intervals, it is often necessary to adjust the interest rateto a time period...
-
Synthesize the products by drawing out reagents and intermediates along the way. `N H. OH HO HO
-
Summarize the types of reports described in this chapter.
-
A. Design a data warehouse star schema for a dimensional database named JRJ-DW. The fact table measure will be Retail Price. B. Create the JRJ-DW database in a DBMS product. C. What transformations...
-
What is the purpose of the Oracle SQL Developer utility?
-
Find the most economical diameter of Sch. 40 commercial steel pipe that would be needed to transport a petroleum fraction with a viscosity of $60 \mathrm{cP}$ and $\mathrm{SG}$ of 1.3 at a rate of...
-
A roof drains into a gutter, which feeds into a downspout with a square cross section (4 in. $x$ 4 in.). The discharge end of the downspout is $12 \mathrm{ft}$ below the entrance and terminates in a...
-
A concrete-lined drainage ditch has a triangular cross section that is an equilateral triangle, $8 \mathrm{ft}$ on each side. The ditch has a slope of $3 \mathrm{ft} / \mathrm{mile}$. What is the...
Study smarter with the SolutionInn App