Home / Expert Answers / Computer Science / consider-the-following-relational-schema-product-maker-model-type-pc-model-speed-ram-hd-pa925

(Solved): Consider the following relational schema: - Product(maker, model, type) - PC(model, speed, ram, hd ...



Consider the following relational schema:
- Product(maker, model, type)
- PC(model, speed, ram, hd, price)
- Laptop(model, sp

Consider the following relational schema: - Product(maker, model, type) - PC(model, speed, ram, hd, price) - Laptop(model, speed, ram, hd, screen, price) - Printer(model, color, type, price) - PriceRange(maker, type, minPrice, maxPrice) which is provided as a SQLite database data.sqlite populated with sample data for all the tables except PriceRange, which is a materialized view storing the minimum and maximum price for every product type (pc, laptop, or printer) for every maker in the database. If a maker does not have a product type, there is no corresponding entry in PriceRange. In this quiz, you have to implement methods that incrementally maintain the materialized view PriceRange under modification operations to the base tables. PriceRange has to be consistent with the other tables. Its content has to reflect the content of the base tables exactly. Moreover, the modification to a base table has to impact only the necessary tuples from PriceRange. You have to determine these operations and implement them as a database application in Java or Python. You have to implement the following 5 methods in Java or functions in Python. The two files Quiz_4. java and Quiz_4 .py contain all the supporting code that allows you to focus only on the required 5 methods: - populatePriceRange populates the PriceRange materialized view with the tuples derived from the original provided data. (10 points) - printPriceRange retrieves all the tuples from PriceRange and prints them sorted in ascending order by maker and type, respectively. ( 5 points) - insertPC inserts data for a new PC passed as function arguments in Product and PC. Morcover, it updates PriceRange when necessary. ( 5 points) - updatePrinter updates the price of a printer specified by its model number with the new price passed as a function argument. Moreover, it updates PriceRange when necessary. (5 points) - deleteLaptop deletes the laptop with the given model number from the database. Moreover, it updates PriceRange when necessary. (5 points)


We have an Answer from Expert

View Expert Answer

Expert Answer


Here is the complete answer to your question Solution: So following relation schema are - Product(maker, model, type) - PC(model, speed, ram, hd, pric
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe