Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help! Question #1 The SQL statement below has an error, please identify it and how to fix it SELECT Guest_ID, Property, extract (month from

image text in transcribed

Please help!

Question #1 The SQL statement below has an error, please identify it and how to fix it SELECT Guest_ID, Property, extract (month from cast (play_date as date)) as month, age group VIP grouping, Location, case when Frequency in ('a.48+') then 'Weekly when frequency in ('b.24-47', c. 12-23') then 'Monthly else 'Infrequent' end as Frequency, sum (case when extract (year from cast (play_date as date)) = 2020 then f_Rev_all end) as Rev_2020, sum (case when extract (year from cast (play_date as date)) = 2019 then f_Rev_all end) as Rev_2019, sum (case when extract (year from cast (play_date as date)) = 2020 then Total_offer_cost end) as Cost_2020, sum (case when extract (year from cast (play_date as date)) = 2019 then Total_offer_cost end) as Cost_2019 WHERE property = 'Tangiers' and extract (month from cast (play_date as date)) = 10 and extract (year from cast (play_date as date)) in (2019,2020) group by 1,2,3,4,5,6,7

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_2

Step: 3

blur-text-image_3

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

Practical Oracle8I Building Efficient Databases

Authors: Jonathan Lewis

1st Edition

0201715848, 978-0201715842

More Books

Students also viewed these Databases questions

Question

Can negative outcomes associated with redundancy be avoided?

Answered: 1 week ago