Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. The GSA is organized into offices. Each office is located in a certain city an

ID: 664300 • Letter: #

Question

. The GSA is organized into offices. Each office is located in a certain city and is identified by a unique name. The GSA monitors the total square footage managed by each office. . GSA customer agencies are identified by their agency_id values. The GSA stores each agencies name, address, city, and phone number. . Agencies may have rental agreements. . Every rental agreement is assigned a unique identifier. . An agency may have zero, one or more rental agreements with the GSA, and one or more agencies can be a party to a rental agreement. For example, the U.S. Courts and the U.S. Marshalls service may share a rental agreement. . The GSA maintains a record of a rental agreement rent amount, and end date.

Explanation / Answer

For able Information we need to create 3 tables

Office

Agencies

Rental

Ofiice have office_id as primary key.

Login as the mysql root user to create database:
$ mysql -u root -p
mysql>

Add a database
mysql> CREATE DATABASE office;

Now, database is created. Use a database with use command, type:
mysql> USE office;

Next, create a table called office with office_id, city, email and area as fields:
mysql> CREATE TABLE office (office_id VARCHAR(20), city VARCHAR(20), email VARCHAR(20), area Int);

To display your tables in office database, enter:
mysql> SHOW TABLES;

Finally, add a data i.e. row to table office using INSERT statement, run:
mysql> INSERT INTO office(id,city,email,area) VALUES(A001,"Delhi","xuz@abc.com","250");

Now we run same sql for Agencies

Agency_id is Primary key and Office_id is foreign key

Rental table have rental_id is primary key and agency_id is foreign key

Office_id City Email Area