Question

In: Computer Science

A small company is expanding into new offices spread across three buildings. To keep track of...

A small company is expanding into new offices spread across three buildings. To keep
track of office furniture, computers, and printers, the company would like a database to
keep track of everything. Each piece of office furniture, computer, or printer is given an
identification number. Each item (which is either a piece of furniture, a computer, or a
printer) is placed in a room of one of three buildings. The building manager is responsible
for the items in their building. The building manager is identified by an employee ID,
first name, last name, and DOB. Draw an ER diagram that will assist in the creation of
this database. After you have constructed your ER diagram, construct your database using
SQL queries on PHPMyAdmin. Lastly, populate the database with dummy data
(https://mockaroo.com/). Submit your ER diagram and screenshots of your queries to
generate the database, in addition to a screenshot of a SELECT query after the database
has been populated, to prove that you have successfully populated the database.

Solutions

Expert Solution

Here you can see the ER Diagram.
Here employee is a manager.
empID is employee id , bgID is the building ID , roomID is the Room ID , itemID is the Item ID, these are the primary keys .
So these are the set of primary keys with which we can able to retrive and find all other tuples form the table uniquely.
here item can be anything like furniture,computer and printer each item is identified by its itemID.

ER-DIAGRAM:

Creating tables in database:

CREATE TABLE Employee(
empID PRIMARYKEY,
fname VARCHAR(20),
lname VARCHAR(20),
dob DATE;
);

CREATE TABLE ITEM(
itemID PRIMARYKEY,
itemdescription VARCHAR(50),
roomID INT NOT NULL
);

CREATE TABLE Building(
bgID PRIMAYRKEY,
bgname VARCHAR(20),
empid INT
);

CREATE TABLE Room(
roomID PRIMARYKEY,
bgID INT,
type VARCHAR(20)
);


Inserting values into tables :

example to insert into table Employee

INSERT INTO Employee(empID,fname,lname,dob) VALUES(1,"justin","beiber","1996-05-20");
INSERT INTO Employee(empID,fname,lname,dob) VALUES(1,"snoop","dog","1975-10-25");
INSERT INTO Employee(empID,fname,lname,dob) VALUES(1,"cristiano","ronaldo","1985-03-11");
INSERT INTO Employee(empID,fname,lname,dob) VALUES(1,"leionel","messi","1990-05-27");


example to insert into table Item

INSERT INTO Item(itemID,itemdescription,roomID) VALUES(100,"bag",50);
INSERT INTO Item(itemID,itemdescription,roomID) VALUES(101,"box",51);
INSERT INTO Item(itemID,itemdescription,roomID) VALUES(102,"bottle",52);
INSERT INTO Item(itemID,itemdescription,roomID) VALUES(103,"laptop",53);

example to insert into table Building

INSERT INTO Building (bgID,bgname,empid) VALUES(23,"rock",50);
INSERT INTO Building (bgID,bgname,empid) VALUES(24,"song1",53);
INSERT INTO Building (bgID,bgname,empid) VALUES(23,"song2",52);
INSERT INTO Building (bgID,bgname,empid) VALUES(23,"rock2",51);

example to insert into table Room

INSERT INTO Room(roomID,bgID,type) VALUES (52,24,"large");
INSERT INTO Room(roomID,bgID,type) VALUES (54,23,"medium");
INSERT INTO Room(roomID,bgID,type) VALUES (51,27,"large");
INSERT INTO Room(roomID,bgID,type) VALUES (53,22,"small");

I hope you find this helpful and don't forget to giver UPVOTE as it means a lot THANKS:)


Related Solutions

Your company is considering expanding by opening new representative offices in the European Union (EU). Nevertheless,...
Your company is considering expanding by opening new representative offices in the European Union (EU). Nevertheless, the size of the investment is significant and top management wishes to have a clearer picture of the current and probably future economic status of the EU. Work out an executive summary describing the features you consider as crucial in making such a decision.
You are going to create a console based program to keep track of a small business...
You are going to create a console based program to keep track of a small business that sells Doodads. First you will need to create a class Doodad that keeps track of two integers and two Strings. Next, create a constructor for the Doodad. Next, add getters and setters for each of the fields (two integers and two Strings). You need to use Doodad.java (see the starter code) Inside your main method ask the user to read in the two...
This is a simple list table of a company trying to keep track of parts that...
This is a simple list table of a company trying to keep track of parts that they sell and orders that came in purchasing those parts (in other words, not a database but a flat one table file). You will design a database for this company so that they won’t be relying on a simple 1 table list system to keep track of their data. Looking at the table below, produce the 3NF of the data. OrderNum OrderDate PartNum Description...
You are tasked to design an application to keep track of sales for your company. Sales...
You are tasked to design an application to keep track of sales for your company. Sales should be tracked for two types of accounts: supplies and services. Complete the following:     Create a UML class diagram for the Account inheritance hierarchy. Your subclasses should be Supplies and Services.     All sales accounts will have an account ID (accountId).     You will need attributes to keep track of the number of hours (numberOfHours) and rate per hour of services provided (ratePerHour)....
Write an executive summary about ABC Company expanding their manufacturing plants, sales offices, and branches abroad...
Write an executive summary about ABC Company expanding their manufacturing plants, sales offices, and branches abroad to China. Many Americans, however, have little knowledge about China's culture. Explain how Americans will adapt to the environment in China and still be able to succeed in the new business.
Continent Construction Company is a building contractor specializing in small commercial buildings. The company has the...
Continent Construction Company is a building contractor specializing in small commercial buildings. The company has the opportunity to accept one of two jobs; it cannot accept both because they must be performed at the same time and Continent does not have the necessary labor force for both jobs. Indeed, it will be necessary to hire a new supervisor if either job is accepted. Furthermore, additional insurance will be required if either job is accepted. The revenue and costs associated with...
Rooney Construction Company is a building contractor specializing in small commercial buildings. The company has the...
Rooney Construction Company is a building contractor specializing in small commercial buildings. The company has the opportunity to accept one of two jobs; it cannot accept both because they must be performed at the same time and Rooney does not have the necessary labor force for both jobs. Indeed, it will be necessary to hire a new supervisor if either job is accepted. Furthermore, additional insurance will be required if either job is accepted. The revenue and costs associated with...
You are the owner of a parasailing company that is expanding operations to a new beachfront...
You are the owner of a parasailing company that is expanding operations to a new beachfront location, and you need to prepare a 3-year analysis for the bank that may loan you the funds to purchase your boat and parasailing equipment. A lot of business is done on a referral basis, where a company pays a fee to a 3rd party to send them customers. However, because of your well-established reputation, you already have received requests for “flights” to be...
You are the owner of a parasailing company that is expanding operations to a new beachfront...
You are the owner of a parasailing company that is expanding operations to a new beachfront location, and you need to prepare a 3-year analysis for the bank that may loan you the funds to purchase your boat and parasailing equipment. A lot of business is done on a referral basis, where a company pays a fee to a 3rd party to send them customers. However, because of your well-established reputation, you already have received requests for “flights” to be...
Lincoln Company manufactures and sells small electric heaters for homes and offices. The company's income state...
Lincoln Company manufactures and sells small electric heaters for homes and offices. The company's income state for the FY2014 is given below: Sales (30,000 units) $1,800,000 Total, $60 per unit, Less variable expenses $1,440,000, $48 per unit, contribution margin $360,000, $12 per unit, less fixed expenses $264,000, Net income $96,000. b. If Lincoln Company increases its price to $100, do you expect the breakeven point in units to be more or less than the number you calculated in question 1a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT