Question: Consider the following simplified data model: - Transactions table called TRADES. It contains the following fields: NB : Transaction number ( unique identifier for each

Consider the following simplified data model:
- Transactions table called TRADES. It contains the following fields:
NB : Transaction number (unique identifier for each transaction)
FAMILY : Transaction family (there are 5 such families, e.g. FOREIGN EXCHANGE, STOCKS, COMMODITIES, etc.)
TYPE : Transaction type (several types can be attached to a given family)
STATUS : Transaction status (LIVE or DEAD)
CURRENCY : Transaction currency code (e.g. USD, EUR, etc.)
- Table of prices, called TRADEP, which contains the following fields:
NB : Transaction number
PRICE : Transaction price
- Table of currencies, called CURRENCIES, which contains the following fields:
CURRENCY : Currency code (e.g. USD, EUR, etc.)
AREA : Code of the geographical zone (ASIA, NORTH_AMERICA, EUROPE, ...)
- Table of prices which are imported from an external system. This table is called IMPORT and contains the following fields:
NB : Transaction number
PRICE : Transaction price
Question 1:
Write a query which returns the number of transactions effected in the ASIA geographical zone and having a zero price.
Question 2:
How could you optimize the previous query ?
Question 3:
Write a query to update the transaction prices with the values of the table of prices imported from the external data feed. This query will apply only to the transactions effected in the ASIA geographical zone and having a zero price.
Question 4:
Please criticize this data model.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!