Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i know its a long project but please answer it based on the format below 1-Introduction 2-Data Requirements and Conceptual Design 3-Database Construction and Population

i know its a long project but please answer it based on the format below

1-Introduction

2-Data Requirements and Conceptual Design

3-Database Construction and Population

4-Querying the Database

5-Database Access from Programs

thank you.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

A database needs to be developed for a letting agency in a big city. The agency rents out prope enants on behalf of the landlords. 1. The company employs staff. Every member of staff has a unique staff ID. In addition, they have a name, a function (like secretary, accountant, etc.), and a monthly salary. 2. In order to locate properties, the agency has split the city into different areas. Each area has a name, by which it can be uniquely identified. For each area, there is a member of staff who is responsible for the properties in the area. 3. For each property that the agency manages there is a property ID by which it can be identified. Moreover, the agency wants to record the address, the type of the property (like flat, house, garage, etc.), the monthly rate, and the deposit that has to be paid by a tenant. Each property is located in some area. 4. Each property is of a specific type, for instance, a flat, a house, or a garage. The possible types are specified by the company. Each possible type needs to be recorded, also if there is no property of that type in the database. 5. Each property is owned by a single landlord. A landlord, however, may own more than one property. A landlord is registered with name, address, and phone number. Each landlord can be uniquely identified by their name and address. 6. A tenant is registered with a tenant ID, a current address, and a phone number. 7. A tenant rents a property by signing a lease. The lease specifies the start date, i.e., the time when the contract begins, and the duration of the lease. A lease is always related to a specific property. For a given property, there cannot be two leases with the same start date. Step 1: Data Requirements and Conceptual Design The goal of the first part of your project is to 1. identify a collection of sample queries, 2. formulate data requirements for your application, 3. draw an ER-diagram that captures these requirements. In the following, we will describe the single steps in more detail. Sample Queries Specify ten example queries that you think are of interest in the domain of your application. You need criteria to decide what to include into the data requirements and what not. A good starting point for developing a database is to identify typical queries that users will pose-either directly or via applications. These queries will be used to direct the formulation of data requirements and to check them for completeness. Write up the queries in plain English. Do not be concerned whether they can actually be expressed in a query language. Data Requirements and ER Diagram In reality, the formulation of requirements and the design of the diagram go hand in hand. So, do both in parallel. Your application should have a size that makes it nontrivial. As a guideline, aim at a diagram of 10 (entities + relationships). The minimum size should be 8 (entities + relationships). Step 2: Constructing and Populating a Database The goal of the second part of your project is to translate the ER-diagram of your project into a relational schema; implement the schema as a MySQL database; and fill your database with data. Translation into Relational Schema Write up a relational schema that is equivalent to your ER diagram. Make sure that you translate not only entities but also relationships and that you also capture, whenever possible, the integrity constraints of your ER diagram. Explain briefly how the various entities and relations are expressed in the relational schema. Whenever there was a choice for the translation, explain the reasons for the choice you made. During the translation, you may find out that the relational schema resulting from the translation does not make a lot of sense. In this case, revise your ER diagram and the data requirements. It is imperative that all documents are consistent with each other. Implementation of the Schema in PostgreSQL Write an SQL script with the commands to create the tables of your database. An SQL script is simply a file with SQL commands. The CREATE TABLE statements must specify: 1. appropriate types for the attributes; 2. the primary key; 3. constraints such as NOT NULL and UNIQUE whenever appropriate; 4. default values where appropriate; 5. FOREIGN KEY constraints, together with the policy for reacting to changes (remember that the default is ON DELETE NO ACTION) Write comments into the script that explain the rationale behind the definition of your constraints. Comments in SQL can be written in two ways: Loading Data Load data into the database. Write a second script that contains INSERT statements for your relations. You may have to pay attention to insert records in such an order that the foreign key constraints are not violated. Part 3: Querying a Database The goal of the third part of your project is to query your database using the SQL query language Requirement Queries As the first step in your requirement collection, you have specified 10 queries from the domain of your application. Now, try to express them in SQL. It may be the case that some of your queries were too ambitious so that they cannot be captured by SQL. In that case explain why you think the query cannot be written as SQL query; identify other queries that can retrieve useful data for your original query and describe how that data has to be processed further to obtain answers for the original query. New Queries Over the Database In addition to the queries stemming from the requirements, write new queries over your database schema that are interesting in your application domain. For each query, first, write in English what it is supposed to do, and then give the SQL code. Part 4: Database Access from a Programming Language The goal of the fourth part of your project is to create an application program in Java or Python (or another language) by which a user can access the database. There is no need for a graphical user interface or anything fancy. A simple command line interface will do. If you write Python programs, PyMySQL is a good package to use. 1. Introduction 2. Data Requirements and Conceptual Design 3. Database Construction and Population 4. Querying the Database 5. Database Access from Programs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

To whom do the conclusions apply?

Answered: 1 week ago

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago