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


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 @ 9:24 AM
Points: 3,068, Visits: 3,292
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: Thursday, September 18, 2014 1:36 PM
Points: 6,002, Visits: 8,267
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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 3:31 AM
Points: 1,700, Visits: 1,117
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 @ 5:39 AM
Points: 3,966, Visits: 5,206
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: Thursday, June 12, 2014 4:19 AM
Points: 701, Visits: 1,145
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: Thursday, September 18, 2014 10:35 AM
Points: 1,825, Visits: 2,175
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: Friday, August 29, 2014 10:20 AM
Points: 1,740, Visits: 6,366
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: Friday, July 4, 2014 9:03 AM
Points: 1,415, Visits: 796
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, September 16, 2014 6:11 AM
Points: 1,393, Visits: 480
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: Tuesday, July 8, 2014 6:22 AM
Points: 117, Visits: 244
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