Question

In: Computer Science

Draw a class diagram for a real estate firm that lists property for sale. The following...

  1. Draw a class diagram for a real estate firm that lists property for sale. The following describes the organization:
  • The firm has a number of sales offices in several states; location is an attribute of sales office.
  • Each sales office is assigned one or more employees. Attributes of employee include employeeID and employeeName. An employee must be assigned to only one sales office.
  • For each sales office, there is always one employee assigned to manage that office. An employee may manage only the sales office to which he or she is assigned.
  • The firm lists property for sale. Attributes of property include propertyName and location.
  • Each unit of property must be listed with one (and only one) of the sales offices.
  • A sales office may have any number of properties listed, or may have no properties listed.
  • Each unit of property has one or more owners. Attributes of owner are ownerName and address. An owner may own one or more units of property. For each property that an owner owns, an attribute called percentOwned indicates what percentage of the property is owned by the owner.

  1. Consider a database schema with a relation EMP whose attributes are as shown below, with types specified for multivalued attributes. (Oracle database for writing SQL)

EMP= (ename, ChildrenSet multiset(Children), SkillSet multiset(Skills))

Children = (name, birthday)

Skills = (type, ExamSet setof(Exams))

Exams = (year, city)

  1. Define the above schema in SQL, with appropriate types for each attribute.
  2. Using the above schema, write the following queries in SQL.
    1. Find the names of all employees who have a child born on or after January 1, 2000.
    2. Find those employees who took an examination for the skill type “typing” in the city “Dayton”.
    3. List all skill types in the relation EMP.

Solutions

Expert Solution

a)

create type Exams( year char(4), city varchar(20) )

create table exams of type Exams;- CREATE TABLE exams as Exams

create type Skills ( type varchar(20), ExamSet Exams multiset )

create table skills of type Skills :-CREATE TABLE skills as Skills

create type Birthday ( day int(2), month char(3), year int(4) )

same ->CREATE TABLE birthaday as Birthday

create type Children (name varchar(50), Birthday birthday )

same -> CREATE TABLE children  as Children

create type Emp( ename varchar(50), ChildrenSet Children multiset, SkillSet Skills multiset )

create table emp of type EMP-> CREATE TABLE emp as Emp

b)

Queries in SQl

i) select ename from emp as e ,e.ChildrenSet as c ,c.birthday as b    where b.year>=2000)

ii) select e.ename from emp as e ,e.SkillSt as s ,s.ExamSet as x where s.type='typing' and x.city='Dayton'

ii) select distinct s.type from emp as e ,e.SkillSet as s


Related Solutions

You are hired to create a database for a Real Estate firm that lists and sells...
You are hired to create a database for a Real Estate firm that lists and sells properties at multiple sales offices . Draw an ER diagram using ERDPlus for the following description of the firm, indicate all primary keys and cardinalities. List any assumptions you made. There are many sales offices in several states. Attributes of a sales office include office number (identifier) and location. Components of location include Address (number & street), City, State and Zip. Each sales office...
Discuss your understanding of determining value for a real estate property using the Sale Comparison Approach,...
Discuss your understanding of determining value for a real estate property using the Sale Comparison Approach, the Cost Approach and the Income Approach from both the residential (personal home) perspective and the commercial investment property perspective.
Design and build objects to be used by a real estate company for listing the properties for sale. A base object of a property is necessary.
IN JAVA OOPDesign and build objects to be used by a real estate company for listing the properties for sale. A base object of a property is necessary. Decide what common about all properties and include these in the property object. Different type of properties are land, commercial and residential. A residential property can be single family and multi family. A commercial can be a commercial can be either a farm or non-farm.Look at real estate websites and decide what...
A real estate broker is offering an apartment building for sale that has the following characteristics:...
A real estate broker is offering an apartment building for sale that has the following characteristics: The asking price is $3.5 million with the land valued at $500,000. The 160 apartment units rent for $250 per month with rent expected to increase by 4% per year starting in year 2. Vacancy and bad debt allowance is 6% of the potential gross income each year. Operating expenses are expected to be 32% of effective gross income each year. The real estate...
Using Crow´s Foot Notation draw this Real Estate Company ER Diagram Carrying out the information collection...
Using Crow´s Foot Notation draw this Real Estate Company ER Diagram Carrying out the information collection of a real estate company that operates in the city and that requires a database design for its operations, we collect the following needs to proceed to a data modeling: The company is dedicated only to the sale of real estate, and on these properties that they call "properties" they possess data such as the property number that identifies them, the type of property,...
When buying a house most buyers focus on the real estate and not the real property....
When buying a house most buyers focus on the real estate and not the real property. First what does this mean and how can it create any potential problems.
Gulf Real Estate Properties, Inc., is a real estate firm in southwest Florida. The company monitors...
Gulf Real Estate Properties, Inc., is a real estate firm in southwest Florida. The company monitors condominium sales by collecting data on location, list price, sale price, and the number of days it takes to sell each unit. Each condo is classified as Gulf View if it is located directly on the Gulf of Mexico or No Gulf View if it is located on the bay or a golf course. The data set contains sales data for 40 Gulf View...
Real estate Describe the diverse functions and responsibilities of property managers generally, and of specific property...
Real estate Describe the diverse functions and responsibilities of property managers generally, and of specific property management positions relative to Residential, Commercial, and Retail Management.
Model a book Draw a class diagram representing a book defined by the following statement: “A...
Model a book Draw a class diagram representing a book defined by the following statement: “A book is composed of a number of parts, which in turn are composed of a number of chapters. Chapters are composed of sections.” First, focus only on classes and associations. Add multiplicity to the class diagram you produced. Refine the class diagram to include the following attributes: • Book includes a publisher, publication date, and an ISBN • Part includes a title and a...
Draw whole class diagram that represent Candy online shopping website. The class diagram should consist of...
Draw whole class diagram that represent Candy online shopping website. The class diagram should consist of following: 1) Inventory Management System 2) Delivery Management System 3) Production Management System 4) Order Management System 5) Payment Management System Note: The website offers special candy that with customer name.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT