Question: Question 1.3 Entity Category OLTP Table Component PROJECT(PID, P_NAME, P_BUDGET_AMOUNT, P_STARTDATE, P_ENDDATE) EXPENSE_ACCOUNTXID, XCODE, XDESCR) Transaction PROJECT_EXPENSES(TID, PID, XID, TRANS_DATE, TRANS_AMOUNT) Given the OLTP table

Question 1.3 Entity Category OLTP Table Component PROJECT(PID, P_NAME, P_BUDGET_AMOUNT, P_STARTDATE, P_ENDDATE) EXPENSE_ACCOUNTXID, XCODE, XDESCR) Transaction PROJECT_EXPENSES(TID, PID, XID, TRANS_DATE, TRANS_AMOUNT) Given the OLTP table descriptions above: a) Write a SQL statement that will create a View that is based on the PROJECT table, and whose columns are PID, P BUDGET Category, and P Length where the values of the 2 derived variables are calculated as follows: Derived Variable Value P BUDGET Category 'Small when P BUDGET_AMOUNT 5250000 'Medium' when 250000
1000000 P Length 'Short' when (P_ENDDATE - P_STARTDATE) 270 b) Write a SQL statement that will create a View that is based on the PROJECT_EXPENSES table and whose columns are PID, XID, TRANS_DATE, Number of Expense Transactions (i.e. COUNT), and Total TRANS AMOUNT (i.e. SUM(TRANS_AMOUNT))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
