SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The Bowling Challenge


The Bowling Challenge

Author
Message
Andy Warren
Andy Warren
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: Moderators
Points: 52103 Visits: 2797
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/awarren/theb

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Bert De Haes
Bert De Haes
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1763 Visits: 233

Hi Andy,

I have some questions :

- Can there be multiple games for 1 UserId in the table ? And if so, should the procedure only list the score of the last game ?

- The inserts in your article all uses FrameNumber = 1. Is it up to the stored prcoedure to correct this, are is it a copy/paste mistake in the article ?

Greetings,

Bert De Haes


James Lean
James Lean
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4871 Visits: 2409

Also:

- can we assume that scores are entered in sequence, ie the RowID can be used to get the order that balls were thrown?

- will the table hold the scores for more than one player?



-----
JL
hurcane
hurcane
Old Hand
Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)Old Hand (315 reputation)

Group: General Forum Members
Points: 315 Visits: 254
I think your sample data in the artice has a typo. Should the last two entries use values of (1,2,4) instead of (1,1,4).

Additionally, how do you intend to represent bonus balls in the tenth. If I bowl a 300, I throw three balls in the tenth frame. Sometimes bowlers refer to these extra balls as the eleventh and twelfth frames.

Would the values be three sets of (1, 10, 10) or would they be (1, 10, 10), (1, 11, 10), and (1, 12, 10)?

I can deal with either methodology. I just need to know what the test data will look like.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)

Group: Administrators
Points: 327551 Visits: 20089
great questions. Ones I han't thought of. I'll ping Andy for some clarification.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Pam Lahoud
Pam Lahoud
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 92

I think the table should also have a GameNumber column so you can track the frames properly for each user if they bowl multiple games on the same day.





The greatest obstacle to transforming the world is that we lack the clarity and imagination to conceive that it could be different. -- Roberto Unger
paulhumphris
paulhumphris
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1498 Visits: 1023
Are there any restrictions on which version of SQL can be used to solve this problem?



Adam Machanic
Adam Machanic
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6843 Visits: 735
What should the output look like if the last frame bowled was a strike and it wasn't the 10th frame? A NULL, maybe?


Frame 5 NULL


Or something else? Standardized output will make it easier for you to programatically test solutions, if that's your plan...

--
Adam Machanic
whoisactive
getanothername
getanothername
SSC-Enthusiastic
SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)SSC-Enthusiastic (145 reputation)

Group: General Forum Members
Points: 145 Visits: 10
two questions:
1. should we compensate for incomplete games, or assume the games are always going to consist of 10 frames?
2. do you want error checking/handling for invalid scores (scores over 10) being entered?



Adam Machanic
Adam Machanic
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6843 Visits: 735
Getanothername, wouldn't you expect error checking to be handled by constraints rather than the query to select the data?

--
Adam Machanic
whoisactive
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search