Suppose you have the following tables in a database. I need help understanding t
ID: 3700368 • Letter: S
Question
Suppose you have the following tables in a database.
I need help understanding the relational algebra expressions. If someone could explain what PY is doing, that would greatly appreicated!
STOCK ticker GE ??? IBM GOOG AMZN PRICE ticker GE GE GE IBM IBM IBM GOOG GOOG GOOG GOOG AMZN AMZN AMZN ??? BAC BAC BAC close $28 $28 $29 exchange NYSE NYSE date 1/19/2016 1/20/2016 1/21/2016 1/19/2016$128 1/20/2016 $121 1/21/2016 $120 1/19/2016$702 1/20/2016$698 1/21/2016$707 1/22/2016$725 1/20/2016 $575 1/21/2016$572 1/22/2016 $596 1/19/2016 1/20/2016 1/21/2016 1/22/2016 name General Electric Bank of America Int'l Bus. Machines Alphabet Amazon NYSE NASDAQ NASDAQ $14 $14 $13 $14 Consider the relational algebra expressions: PY- PRICE DkPRICE.ticker-YDAY.tickerAPRICE.date-YDAY.date+1day ? PRICE.close-YDAY.close ?YDAY (PRICE), PD , (PY)), and ? ?PRICE.date(?PRICE.ticker-. ,IBM X ? (PY) PD Here, we use the notation to simply give intermediate expressions short names (PY, PD, and X) Question 2.3.1 [5 points] Describe in plain English what PY corresponds to; as before, be precise but concise. Question 2.3.2 [5 points] Describe in plain English what PD and X correspond to; be precise but concise. Question 2.3.3 [5 points] What is the result for X? Don't forget to also indicate it's schema. PRICE.ticker,PRICE.dateExplanation / Answer
PY corresponds to "Price Table self-join to PRICE Table based on Conditions(Joins) Ticker of PRICE equal to Ticker of Y or date of PRICE equal to date+1 of Y or close of PRICE is Less than or equal to close of Y and rename(Show) the PRICE Result as YDAY"
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.