Advanced Querying of Property Management Staff and Client Relationships
This document outlines the functional data models and relationships involving staff, properties for rent, and clients within a property management system. It discusses entity inheritance and the implementation of a query language to retrieve relevant data, such as staff details, properties managed, and client interactions. The example provided illustrates how to effectively query the database using conditions based on staff numbers, demonstrating the relationships and management structure in place.
Advanced Querying of Property Management Staff and Client Relationships
E N D
Presentation Transcript
Functional Data Models • Entities • Relationships • Inheritance • Functional Query Languages
Staff() → ENTITY PropertyForRent() → ENTITY staffNo(Staff) → STRING sex(Staff) → CHAR salary(Staff) → REAL Name() → ENTITY Name(Staff) → NAME fName(Name) → STRING lName(Name) → STRING Entities
Manages(Staff) PropertyForRent ManagedBy(PropertyForRent) → Staff INVERSE OF Manages Views(Client) PropertyForRent ViewedBy(PropertyForRent) Client INVERSE OF Views Relationships
Staff() → ENTITY Supervisor() → ENTITY IS-A-STAFF(Supervisor) → Staff fName(Staff) → fName(Name(Staff)) fName(Supervisor) → fName(IS-A-STAFF(Supervisor)) Inheritence
RETRIVE lName(Name(ViewedBy(Manages(Staff)))) WHERE staffNo(Staff) = 'SG14' RETRIVE Staff.Manages.ViewedBy.Name.lName WHERE Staff.staffNo = 'SG14' Functional Query Languages
SELECT c.lName FROM Staff s, PropertyForRent p, Viewing v, Client c WHERE s.staffNo = p.staffNo AND p.propertyNo = v.propertyNo AND v.clientNo = c.clientNo AND s.staffNo = 'SG14' SQL version