Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me with this. specially number 4 and 5. this is my first time posting in chegg. i hope someone will help me with

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
please help me with this. specially number 4 and 5. this is my first time posting in chegg. i hope someone will help me with this. due date is tonight.
image text in transcribed
Objective: For this assignment, you will use SQL to create a number of relational tables, insert entries into the tables and perform a series of queries on the resulting relational tables. Requirements: Create: Convert the ER diagram on the last page into a set of schemas. Create the corresponding tables. Note that the ER diagram is similar to the one you should have created for Homework 1, Problem A. Except for two cases, you should have a table for each entity set or relationship set in the diagram. The total number of tables should be 14. Insert: Insert the following information into the appropriate tables. (Data is meant to depict fictitious situations). Note that the data in the following lists may have to be put into more than one table; that is, the lists do not always correspond to one table. The following are the addresses of where people live (pid, streetAddress, city, state): 10234, 342 streetA, Monticello, MN 10234, 344 streetA, Monticello, MN 11567, 65 streets, St. Cloud, MN 3289, 892 streetM, Minneapolis, MN 17645, 342 streetB, Monticello, MN 88331, 342 streetc, Monticello, MN The following is information about people (pid, name): 10234, Able 11567, Baker 3289, George 17645, Mary 88331, Alice 88432, Jane The following is information about the creation of Inventories of the stated address (pid, cdate, inid, name, street Address, city, state): 10234, 01-dec-04, 101, Home Contents, 798 Street E, Duluth, MN 10234, 01-dec-19, 102, Home Contents, 798 Street, Duluth, MN 3289, 31-oct-12, 103, ABC-Grocery, 342 streetc, Monticello, MN 17645, 31-oct-00, 105, MyGrocery. 342 street, Monticello, MN 11567, 31-jan-20, 107, Home Contents, 11567, 65 streets, St. Cloud, MN 88331, 31-oct-00, 111, Rental, 798 Street, Minneapolis, MN 88331, 31-oct-00, 113, Rental, 798 Street, Hibbing, MN The following is information about where Inventores are stored inid, street Address, city, state): 102, 798 Street, Duluth, MN 107, 65 streets, St. Cloud, MN 113, 798 Street E, Duluth, MN The following is information about the I-items that people own (iid, inid, value, pid, odate, type (not an attribute), other info depending on type): 1, 101, 100.00, 10234, 31-dec-02, Furniture, table 3, 101, 205.00, 10234, 01-mar-00, Furniture, desk 5, 101, 15.00, 10234, 01-jul-01, Furniture, chair 7, 101, 1000.00, 10234, 22-dec-99, Vehicle, red 11, 101, 100.00, 10234, 15-jun-03, Furniture, TV 13, 101, 50000.00, 10234, 28-feb-95, Building, rambler, 7 17. 102. 350.00, 10234, 30-sep-10, Furniture, sofa 19, 102, 400.00, 10234, 01-mar-00, Furniture, desk 23, 102, 15.00, 10234, 01-jul-01, Furniture, chair 29, 102, 100.00, 10234, 22-dec-99, Vehicle, red 31, 102, 10.00, 10234, 15-Jun-03, Furniture, TV 37, 102, 100000.00, 10234, 28-feb-95, Building, rambler, 7 41, 103, 150000.00, 3289, 1-may-90, Building, store, 4 43, 103, 20000.00, 3289, 1-may-12, Vehicle, blue 47, 103,500.00, 3289, 1-sep-89, Furniture, cash register 53, 105, 7000.00, 11567, 10-oct-10, Vehicle, green 57, 105, 700.00, 11567, 23-sep-09, Furniture, 7 shelves 59, 105, 175000.00, 88331, 30-sep-70, Building, store, 10 61, 107, 500.00, 11567, 04-feb-19, Furniture, TV 67, 111, 225000.00, 88331, 30-sep-70, Building, store, 5 71, 113, 105000.00, 88331, 30-sep-70, Building, store, 3 Note: the above information goes into as many as 6 different tables. The following is information about insurance companies and where they are located (sid, name, streetAddress, city, state) 7760, ABC-Insurance, 798 Street E, Minneapolis, MN 7761, My Insurance, 798 Street, Hibbing, MN The following is information about what insurance companies insure (sid, id) 7760, 59 7761, 67 7761, 71 7760,29 7761, 37 7760, 41 7761, 43 Display: Display the contents of the tables that you created in the previous step. Required Queries: Perform the following queries using SQL. List all inventories that contain items that were not owned when the inventory was made. List inventory inid and name. For each inventory that has a stored at address, list those inventories that are stored at a different address than the address of the inventory (the address that the inventory is about). List the inid value. For each person, list the total number of inventories that the person has taken. Include pid, person name and total for each entry in the list. If a person has not taken an inventory, total is to be set to zero. This list must include people who have not taken any inventories. Sort the list by total number of inventories taken. Find the total monetary value of all vehicles owned by Able. Find the names of the insurance companies that insure the building they are located at List the value of the items on all inventories taken by either George or Mary. The list is to be sorted by value and include: pid, inid, lid and value. List the people (pid and name) who have taken at least one inventory that contained items that they own. List the people that own both a building and a vehicle that are insured but by different insurance companies. You must include: pid, name, iid of building, the fact it is a building, name of insurance company insuring the building, iid of vehicle, the fact it is a vehicle, and name of company insuring the vehicle. Sort the list by pid in ascending order. The fact that an item is a building or a vehicle should be shown by displaying the word: building or vehicle, respectively In addition to the SQL commands and printed output from the execution of these queries, you are to justify the results in writing. For each query, the command, result and justification are to be listed adjacent to each other. Display of duplicate tuples must be eliminated. Your queries must be capable of producing correct results for ANY instance of the tables. Additional Queries: Devise two additional queries of your own that use this database. For each of these queries you must include: i. A written description of what the query is to return. ii. The corresponding SQL command. iii. The result of the query. iv. Justification of the result. Points for this part may be based on complexity of the query as well as correctness. Turn-in: A printed summary report that contains output showing: SQL commands resulting in successful table creation. The contents of each table after all tuples have been added to it. SQL queries, results of each query and justifications; these are to be displayed next to each other for each query. The font size used in your report must be 11 or 12 point. The font appearing in any screen shots must be of comparable size. Include your Oracle account number in your report. pid name Street Address City State ) Person Lives At Located Insurance Company Address Stored name Inventory Makes inid name cdate Contains insures value I-items Owned odate color description Building Furniture Vehicle description nRooms Objective: For this assignment, you will use SQL to create a number of relational tables, insert entries into the tables and perform a series of queries on the resulting relational tables. Requirements: Create: Convert the ER diagram on the last page into a set of schemas. Create the corresponding tables. Note that the ER diagram is similar to the one you should have created for Homework 1, Problem A. Except for two cases, you should have a table for each entity set or relationship set in the diagram. The total number of tables should be 14. Insert: Insert the following information into the appropriate tables. (Data is meant to depict fictitious situations). Note that the data in the following lists may have to be put into more than one table; that is, the lists do not always correspond to one table. The following are the addresses of where people live (pid, streetAddress, city, state): 10234, 342 streetA, Monticello, MN 10234, 344 streetA, Monticello, MN 11567, 65 streets, St. Cloud, MN 3289, 892 streetM, Minneapolis, MN 17645, 342 streetB, Monticello, MN 88331, 342 streetc, Monticello, MN The following is information about people (pid, name): 10234, Able 11567, Baker 3289, George 17645, Mary 88331, Alice 88432, Jane The following is information about the creation of Inventories of the stated address (pid, cdate, inid, name, street Address, city, state): 10234, 01-dec-04, 101, Home Contents, 798 Street E, Duluth, MN 10234, 01-dec-19, 102, Home Contents, 798 Street, Duluth, MN 3289, 31-oct-12, 103, ABC-Grocery, 342 streetc, Monticello, MN 17645, 31-oct-00, 105, MyGrocery. 342 street, Monticello, MN 11567, 31-jan-20, 107, Home Contents, 11567, 65 streets, St. Cloud, MN 88331, 31-oct-00, 111, Rental, 798 Street, Minneapolis, MN 88331, 31-oct-00, 113, Rental, 798 Street, Hibbing, MN The following is information about where Inventores are stored inid, street Address, city, state): 102, 798 Street, Duluth, MN 107, 65 streets, St. Cloud, MN 113, 798 Street E, Duluth, MN The following is information about the I-items that people own (iid, inid, value, pid, odate, type (not an attribute), other info depending on type): 1, 101, 100.00, 10234, 31-dec-02, Furniture, table 3, 101, 205.00, 10234, 01-mar-00, Furniture, desk 5, 101, 15.00, 10234, 01-jul-01, Furniture, chair 7, 101, 1000.00, 10234, 22-dec-99, Vehicle, red 11, 101, 100.00, 10234, 15-jun-03, Furniture, TV 13, 101, 50000.00, 10234, 28-feb-95, Building, rambler, 7 17. 102. 350.00, 10234, 30-sep-10, Furniture, sofa 19, 102, 400.00, 10234, 01-mar-00, Furniture, desk 23, 102, 15.00, 10234, 01-jul-01, Furniture, chair 29, 102, 100.00, 10234, 22-dec-99, Vehicle, red 31, 102, 10.00, 10234, 15-Jun-03, Furniture, TV 37, 102, 100000.00, 10234, 28-feb-95, Building, rambler, 7 41, 103, 150000.00, 3289, 1-may-90, Building, store, 4 43, 103, 20000.00, 3289, 1-may-12, Vehicle, blue 47, 103,500.00, 3289, 1-sep-89, Furniture, cash register 53, 105, 7000.00, 11567, 10-oct-10, Vehicle, green 57, 105, 700.00, 11567, 23-sep-09, Furniture, 7 shelves 59, 105, 175000.00, 88331, 30-sep-70, Building, store, 10 61, 107, 500.00, 11567, 04-feb-19, Furniture, TV 67, 111, 225000.00, 88331, 30-sep-70, Building, store, 5 71, 113, 105000.00, 88331, 30-sep-70, Building, store, 3 Note: the above information goes into as many as 6 different tables. The following is information about insurance companies and where they are located (sid, name, streetAddress, city, state) 7760, ABC-Insurance, 798 Street E, Minneapolis, MN 7761, My Insurance, 798 Street, Hibbing, MN The following is information about what insurance companies insure (sid, id) 7760, 59 7761, 67 7761, 71 7760,29 7761, 37 7760, 41 7761, 43 Display: Display the contents of the tables that you created in the previous step. Required Queries: Perform the following queries using SQL. List all inventories that contain items that were not owned when the inventory was made. List inventory inid and name. For each inventory that has a stored at address, list those inventories that are stored at a different address than the address of the inventory (the address that the inventory is about). List the inid value. For each person, list the total number of inventories that the person has taken. Include pid, person name and total for each entry in the list. If a person has not taken an inventory, total is to be set to zero. This list must include people who have not taken any inventories. Sort the list by total number of inventories taken. Find the total monetary value of all vehicles owned by Able. Find the names of the insurance companies that insure the building they are located at List the value of the items on all inventories taken by either George or Mary. The list is to be sorted by value and include: pid, inid, lid and value. List the people (pid and name) who have taken at least one inventory that contained items that they own. List the people that own both a building and a vehicle that are insured but by different insurance companies. You must include: pid, name, iid of building, the fact it is a building, name of insurance company insuring the building, iid of vehicle, the fact it is a vehicle, and name of company insuring the vehicle. Sort the list by pid in ascending order. The fact that an item is a building or a vehicle should be shown by displaying the word: building or vehicle, respectively In addition to the SQL commands and printed output from the execution of these queries, you are to justify the results in writing. For each query, the command, result and justification are to be listed adjacent to each other. Display of duplicate tuples must be eliminated. Your queries must be capable of producing correct results for ANY instance of the tables. Additional Queries: Devise two additional queries of your own that use this database. For each of these queries you must include: i. A written description of what the query is to return. ii. The corresponding SQL command. iii. The result of the query. iv. Justification of the result. Points for this part may be based on complexity of the query as well as correctness. Turn-in: A printed summary report that contains output showing: SQL commands resulting in successful table creation. The contents of each table after all tuples have been added to it. SQL queries, results of each query and justifications; these are to be displayed next to each other for each query. The font size used in your report must be 11 or 12 point. The font appearing in any screen shots must be of comparable size. Include your Oracle account number in your report. pid name Street Address City State ) Person Lives At Located Insurance Company Address Stored name Inventory Makes inid name cdate Contains insures value I-items Owned odate color description Building Furniture Vehicle description nRooms

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

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

Graph each function. Give the domain and range. f(x)=x + 3-3

Answered: 1 week ago

Question

2. How should this be dealt with by the organisation?

Answered: 1 week ago

Question

explain what is meant by the term fair dismissal

Answered: 1 week ago