CSCI 370 Spring 2026 - Assignment 3
Due: 8:00am, 6 February 2026, Friday

Assignment Information

The following relational schema (primary keys are underlined) are used by the real estate company mostly as described in Assignment 1, with one extra specification that "When a listed property is sold, it is sold by a realtor that may or may not be same as the listing realtor". The ER diagram in Assignment 2 now reflects the extra specification.

Properties(folio, civicAddress, zoning, builtYear, description)
MajorProjects(folio, year, description)
Realtors(RID, serviceName, name, contactInfo, expLevel)
Listings(listingID, folio, listedBy, listDate, status, description, askingPrice)
ClosedListings(listingID, soldBy, closingDate, purchasePrice)
Clients(email, name, otherInfo)
Leads(email, listingID, interest)

This assignment is based on the above relational schema.

Many more details, including constraints, data types, etc, are captured in the SQL definitions of these tables.

You may use the supplied table definitions to create empty tables. You will then need to populate the tables (insert sample data) yourself in order to test your SQL queries logically.

Your Tasks:

Express each of the following queries in an equivalent Relational Algebra query, Datalog query and SQL query respectively against the relational schema defined above.
(Note that your relational algebra and datalog queries can borrow some comparison operators from SQL, such as "is null" and "like", and functions from Oracle SQL, such as to_date and to_char.)

  1. List the service name, contact information and experience level of each realtor.
  2. List the email and other information of each anonymous client. Anonymous clients are the ones who leave no names.
  3. For each closed listing whose purchasing price is more than $10,000 higher than its asking price, list its civic address and its listing realtor's service name.
  4. For each active listing (those whose status is 'Active'), list its civic address, date it's been listed in the format of 'Month dd, yyyy', service name of its listing realtor, and its asking price.
    (Note that your relational algebra and datalog query don't need to worry about the format of the listing date.)
  5. List the full civic address and the built year of each property that is located on the street 'Icarus' and has at least one major project done on it since its built. There shouldn't be any duplicates in the result.

How to Submit

You are expected to include a legend to explain your relational algebra operators used in this assignment, and to include your Datalog and SQL queries in a text file (with the extension name .txt or .sql), and to include your Relational Algebra queries in the same text file or in a separated PDF file.

Make your queries logically correct and easy to understand. Make sure that your SQL queries can be successfully executed by Oracle database engine.

You can submit your assignment solutions using one of the following two ways:


Last updated: January 29, 2025