Question

Really need help on this, apperciate all answers and feedback =D. You are the Senior Consultant...

Really need help on this, apperciate all answers and feedback =D.

You are the Senior Consultant at Abacus Consulting, tasked with the database project for Amadeus Real Estate client. The company employs real estate agents who work with customers to buy and sell properties (both residential and commercial). As part of your lead role, you are initially responsible for meeting with the client team and gathering requirements. You are then scheduled to design the data model and implement a working prototype to demonstrate the validity of the data model. Your specific tasks are broken down as below

Phase 1 – Requirements Gathering

As part of the requirements phase, develop a minimum of 10 business rules that apply to the client’s business. Each business rule must be related to a data model feature and must be clearly demonstrated in the data model (developed in phase-2).

Phase 2 – Database Design

Develop a database model (ERD) based on the business rules developed in Phase-1. Use the Crow’s Foot notation, indicate all attributes, primary/foreign key relationships, cardinalities and relationship strengths.

[Deliverable: ERD]

Phase 3 – Implementation (50 points)

Implement the table structure based on the ERD developed in phase-2. Assume property details (type, area, list price, sale price …etc). Assume 3% commission on all transactions.

Write the SQL code to create the needed tables. Ensure all primary keys, foreign keys and constraints are defined.

After implementing the table structures, insert dummy data for 25 transactions, placed between January-1-2015 and June-30-2015.

Phase 4 – Validation

To validate the data model you have developed in phase-3, you are asked to write some queries and verify the results with expected results.

Write the SQL statements that provide the following information:

Number of sales for the period March-1-2015 to March-31-2015

Agent who sold the most number of properties between Feb-1-2015 to June-30-2015.

Agent who sold the most $$ value of properties between Jan-1-2015 to Mar-31-2015.

Most expensive property sold between Jan-1-2015 to June-30-2015.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CREATE TABLE  "PERSON" 
   (    "PERSONID" VARCHAR2(20) NOT NULL ENABLE, 
        "LASTNAME" VARCHAR2(50) NOT NULL ENABLE, 
        "MIDDLENAME" VARCHAR2(50) NOT NULL ENABLE, 
        "INITIALS" VARCHAR2(5) NOT NULL ENABLE, 
        "TITLE" VARCHAR2(3) NOT NULL ENABLE, 
        "GENDER" CHAR(1) NOT NULL ENABLE, 
        "BIRTHDATE" DATE NOT NULL ENABLE, 
         CONSTRAINT "PERSON_PK" PRIMARY KEY ("PERSONID")
  USING INDEX  ENABLE
   );
CREATE TABLE  "OWNER" 
   (    "PERSONID" VARCHAR2(20) NOT NULL ENABLE, 
         CONSTRAINT "OWNER_PK" PRIMARY KEY ("PERSONID")
  USING INDEX  ENABLE
   );
ALTER TABLE  "OWNER" ADD CONSTRAINT "OWNER_FK" FOREIGN KEY ("PERSONID")
          REFERENCES  "PERSON" ("PERSONID") ENABLE;
CREATE TABLE  "CLIENT" 
   (    "PERSONID" VARCHAR2(20) NOT NULL ENABLE, 
        "MAXPRICE" NUMBER(10,2), 
         CONSTRAINT "CLIENT_PK" PRIMARY KEY ("PERSONID")
  USING INDEX  ENABLE
   );
ALTER TABLE  "CLIENT" ADD CONSTRAINT "CLIENT_FK" FOREIGN KEY ("PERSONID")
          REFERENCES  "PERSON" ("PERSONID") ENABLE;
CREATE TABLE  "AGENT" 
   (    "PERSONID" VARCHAR2(20) NOT NULL ENABLE, 
        "OFFICE" VARCHAR2(100), 
         CONSTRAINT "AGENT_PK" PRIMARY KEY ("PERSONID")
  USING INDEX  ENABLE
   );

ALTER TABLE  "AGENT" ADD CONSTRAINT "AGENT_FK" FOREIGN KEY ("PERSONID")
          REFERENCES  "PERSON" ("PERSONID") ENABLE;
CREATE TABLE  "CLIENT" 
   (    "PERSONID" VARCHAR2(20) NOT NULL ENABLE, 
        "MAXPRICE" NUMBER(10,2), 
         CONSTRAINT "CLIENT_PK" PRIMARY KEY ("PERSONID")
  USING INDEX  ENABLE
   );
ALTER TABLE  "CLIENT" ADD CONSTRAINT "CLIENT_FK" FOREIGN KEY ("PERSONID")
          REFERENCES  "PERSON" ("PERSONID") ENABLE;

Number of sales for the period March-1-2015 to March-31-2015

select count(*) from sales where saledate between
to_Date('Mar-01-2015','Mon-dd-yyyy') and to_date('Mar-31-2015','Mon-dd-yyyy') ;

Agent who sold the most number of properties between Feb-1-2015 to June-30-2015.

select * from (
select * from (
(select agentpersonId , count(*) as numSold from sales where saledate between to_Date('Feb-01-2015','Mon-dd-yyyy') and to_date('Jun-30-2015','Mon-dd-yyyy')
group by agentpersonId)
) order by numSold desc )
where rownum = 1;


Agent who sold the most $$ value of properties between Jan-1-2015 to Mar-31-2015.

select * from (
select * from (
(select agentpersonId , sum(price) as dollarAmount from sales where saledate between to_Date('Jan-01-2015','Mon-dd-yyyy') and to_date('Mar-31-2015','Mon-dd-yyyy')
group by agentpersonId)
) order by dollarAmount desc )
where rownum = 1;

Most expensive property sold between Jan-1-2015 to June-30-2015.


select propertyId ,price from
(
(select propertyId,price from sale
where
saledate between to_Date('Jan-01-2015','Mon-dd-yyyy') and to_date('Jun-30-2015','Mon-dd-yyyy')
order by price desc )
) where rownum =1;

Add a comment
Know the answer?
Add Answer to:
Really need help on this, apperciate all answers and feedback =D. You are the Senior Consultant...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • PLEASE HELP, WILL GIVE THUMBS UP ON ALL MY ACCOUNTS, PLEASE FOLLOW CAREFULLY This practice will...

    PLEASE HELP, WILL GIVE THUMBS UP ON ALL MY ACCOUNTS, PLEASE FOLLOW CAREFULLY This practice will aid you in creating an ERD diagram. Explaining the entities the relationships and all the cardinalities that your business holds. Write up a database application to solve a business problem. This is to describe the nature of the problem or a solution to the problem. You are able to use any business as your written ERD diagram ie:  a Lifetime Fitness gym, any college school,...

  • DATABASES You are required to design and implement a relational database to help the local community...

    DATABASES You are required to design and implement a relational database to help the local community center better serve the residents in your neighborhood. Database Specifications: In your preliminary analysis, you have determined the following basic facts about the community center and the services it provides to the residents in the neighborhood: - The community center serves multiple areas which fall into different zip codes.  - The community center provides collaborative family based care services. An immediate family is...

  • Chapter 10 • Data Quality and Integration 10-31 your instructor to download from the book's Web...

    Chapter 10 • Data Quality and Integration 10-31 your instructor to download from the book's Web site. Your instructor can make those databases available to you. Alternatively, these and other databases are available at www.teradatastudentnetwork.com (your instructor will tell you the login password, and you will need to register and then create an SQL Assistant log-in for the parts of this question). There may actually be another database your instructor wants you to use for this series of questions. Regardless...

  • SUBJECT: INFORMATION TECHNOLOGY, CLASS: ADVANCE DATABASE MANAGEMENT Hello Everyone, I need help on a project for...

    SUBJECT: INFORMATION TECHNOLOGY, CLASS: ADVANCE DATABASE MANAGEMENT Hello Everyone, I need help on a project for my ITD 256 Class. These are the questions I am suppose to answer: Project: The project should include designing a database deals with making a proposal for the database implementation. You can either try to fix an existing problem in your business or create a new database for the new projects or new clients. Please define the objective, scope, and time frame of your...

  • Query #4 Please "Which street in the suburb Camperdown has the highest average rent" in LISTING,...

    Query #4 Please "Which street in the suburb Camperdown has the highest average rent" in LISTING, the "type" column determines if it is "rent" or "sell" Thankyou Views PROPERTY [pid, stno, stname, sttype, suburb, state, postcode, carspaces] Write the following queries in SQL in your PROPERTY database: SHAREDPROPERTY unitno,pid, proptype] AGENCY [agencylicence, agencyname, website, phone] 1. List all townhouses sold in the suburb Annandale in 2016 2. Find the suburbs that have not had any sales since 2017 BRANCH agencv,...

  • #1) Display Last Name, First Name, DonorId, Fundname, TotalPledged from the donor’s database (you may need...

    #1) Display Last Name, First Name, DonorId, Fundname, TotalPledged from the donor’s database (you may need to use donor and pledge tables to get the information) for Donor ID 59034. (Your results window should have 3 rows) #2) Display all records from the PurchaseOrderHeader from the AdventureWorks Database that were sold by Employee 261 (Your results window should have 401 rows) #3) Display salesorderid, orderdate, totaldue, and territory name from salesorderheader and salesterritory for all totaldue that are greater than...

  • Topic: Inventory Manangement Part A. Database Creation Your database should have a minimum of 4 tables...

    Topic: Inventory Manangement Part A. Database Creation Your database should have a minimum of 4 tables and include both one-to-many and many-to-many relationships. Be sure to include some numeric and/or date fields. Define all appropriate constraints, using the proper naming conventions (see Structure Notes below). Populate your database with at least 30 records in the main table(s), and whatever is needed in related tables. Submit the following: • a short description of the purpose of the database and what the...

  • 4. In Chapter 4, you saw the creation of the Tiny College database design, which reflected...

    4. In Chapter 4, you saw the creation of the Tiny College database design, which reflected such business rules as "a professor may advise many students" and "a professor may chair one department." Modify the design shown in Figure 4.36 to include these business rules: . An employee could be staff, a professor, or an administrator. .A professor may also be an administrator. Staff employees have a work-level classification, such as Level I or Level II. Only professors can chair...

  • this is about databases and SQL, please help me with this and i promise i will...

    this is about databases and SQL, please help me with this and i promise i will thumbs you up :) let me know if you need more info please try to get this done i will definitely thumbs you up :)) PROJECT TOPIC: Library: Books, Copies of the books, Patrons, Checkouts when creating ERD diagram, the notation must be in crows notation, attached at the bottom is an example of crows foot notation in databases so you can understand. PDF...

  • this is about databases and SQL, please help me with this and i promise i will...

    this is about databases and SQL, please help me with this and i promise i will thumbs you up :) let me know if you need more info please try to get this done i will definitely thumbs you up :)) PROJECT TOPIC: Library: Books, Copies of the books, Patrons, Checkouts when creating ERD diagram, the notation must be in crows notation, attached at the bottom is an example of crows foot notation in databases so you can understand. PDF...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT