Question Get Answer

Question 1<br/>How many winning tickets hitting the jackpot (i.e.

the ticket has a line that has both the winning lotto combination and power ball) in draw 1545? Write a SQL statement to list all winning tickets by projecting two columns, ticketNo and location. The first column shows the ticketNo of the winning ticket in draw 1545, and the second column shows the full address of the physical place where the ticket is sold or if it is sold online. You must provide all relevant logics and/or assumptions you have applied as part of the answer for your SQL statement.


Question 2
Among all draws in 2019, how often is the winning power ball an even number? Write a SQL statement to list all the draw records in 2019 with an even power ball number by projecting three columns, drawNo, drawDate and pbNo. Order the list by drawDate in descending order. You must provide all relevant logics and/or assumptions you have applied as part of the answer for your SQL statement.


Question 3
Write a SQL statement to create a view named RecentDraws that shows the detail of the last 4 draws with ten columns: drawNo, drawDate, n1, n2, n3, n4, n5, n6, pbNo and revenue. It is assumed that each line of a ticket generates $1.5 of revenue. For presentation purpose, the value of the column revenue is formatted with a leading dollar sign. You must provide all relevant logics and/or assumptions you have applied as part of the answer for your SQL statement.





Needs to be written in SQLite

Q3, Q4.png

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 MYSQL tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes