Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Precedence in math Expand / Collapse
Author
Message
Posted Thursday, January 10, 2013 1:30 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 1:16 AM
Points: 2,826, Visits: 2,836
Thanks for the question Ron. Easy point today and without the need for coffee

-------------------------------
Posting Data Etiquette - Jeff Moden
Smart way to ask a question

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
Post #1405251
Posted Thursday, January 10, 2013 2:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:49 PM
Points: 5,794, Visits: 8,007
If this is an easy starter for a series of questions that gradually builds up, then it's sort of okay - though probably TOO easy.

As a stand alone question, I am not excited about it. The use of parentheses in all the queries means that there is no ambiguity anywhere, even for those who don't know the rest of the arithmetic precedence rules (and I would hope that almost everyone would get the question right even if there were no parentheses used in some of the queries).
Also, why use a blog post as the only reference, when a 5 second Google search would have given you this Books Online link?



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1405274
Posted Thursday, January 10, 2013 2:45 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Yesterday @ 4:49 AM
Points: 1,491, Visits: 976
While it does appear to just test basic maths, I'd argue that doing an example without brackets is just annoying, and I'd be pretty displeased if debugging someone's SQL who had not bothered to put in some brackets for anything except basic addition / subtraction. Still I suppose something could have been done to spice it up, but I guess I'm not coming up with anything *shrugs*
Post #1405292
Posted Thursday, January 10, 2013 3:32 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 6:40 AM
Points: 3,683, Visits: 4,818
Good back-to-basic mathematics question; Thanks, Ron

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1405311
Posted Thursday, January 10, 2013 4:41 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 10:34 AM
Points: 701, Visits: 1,140
Thanks for easy one. Giving us the parens even made it easier.
Post #1405343
Posted Thursday, January 10, 2013 5:09 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 7:35 AM
Points: 1,625, Visits: 2,034
Thank you Ron. I don't mind an easy question once in a while. Besides, I'm just paranoid enough to have looked it over an extra time to see if I was missing something. There's value in that too.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1405350
Posted Thursday, January 10, 2013 5:14 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 7:26 AM
Points: 1,658, Visits: 6,002
BODMAS

currently 7 wrong answers...
Post #1405353
Posted Thursday, January 10, 2013 6:06 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 9:09 AM
Points: 1,337, Visits: 746
Wow, only 98% correct so far!
Post #1405375
Posted Thursday, January 10, 2013 6:41 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 6:27 AM
Points: 1,378, Visits: 454
Nice attempt at the question, however I think this one is flawed

Seeing how result two does not need the parentheses that is


SELECT @A + (@B-@C) AS 'Result #2'

is the same as

SELECT @A + @B-@C AS 'Result #2'

And there is only one answer with 1 as the second option. The user can guess at the answer without understanding the concept

I would have thought

SELECT @A + @B * @C AS 'Result #4'

would have been more challenging without the parentheses for most people.
Post #1405395
Posted Thursday, January 10, 2013 6:41 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: 2 days ago @ 10:22 AM
Points: 112, Visits: 237
BODMAS :)

Edit: Shucks... Toreador, beat me to it.

OK PEMDAS




Wayne

Did you get access denied? Great the security works.

Post #1405396
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse