Just curious, what are your SQL pet peeves ?

  • Yes, I've also learned that there are 7 continents. BTW, Luis, I appreciate that you didn't use AS as your alias in your query. That would have been a pet peeve - using a keyword as any type of object name.

  • Ed Wagner (6/5/2014)


    I know this is going to be controversial, but I think that education is a fine thing. However, in the I.T. industry, the best thing it teaches you is how to learn. Learning to do things well usually occurs after school is done.

    Not just in the IT industry. I don't know about all subjects, but certainly maths, computerscience, natural languages are all topics where the most important thing you take from education is knowing how to learn and willingness to work hard in order to learn.

    Tom

  • SQL is delicious (6/5/2014)


    TomThomson (6/5/2014)

    Having worked both in India with Indians and in American with Americans, I have to sort of agree with him - but his comparisons take it much too far. I regard an American bachelor's degree summa cum laude in many universities as roughly equivalent to British bottom-ranked university pass degree, and Indian degrees mostly fit somewhere in between. But things vary enormously between universities, and a good American university as about the same as a good British university - the problem with America is that it has a lot of poor universities (Britain has too, I think, but nowhere near as high a proportion as America, and maybe not now as opposed to in the past since things are thought to have impreoved here), not that it has no good ones.

    Interesting. I've lived in the UK before (2001-2007) and I kind of disagree with you about education. There's no denying that some American universities are little more than degree mills, churning out unprepared graduates. However, I've worked with many degreed/A-level qualified British professionals who claimed to know more than I did about...well...everything, because they had studied the subject "at uni" or held an A-level in that subject.

    An A-level is pretty meaningless unless it has a very high grade. People who think they know a subject because they have an A-level are idiots, and probably don't get a high A-level grade because if they did the would probably know enough about the subject to know they knew very little.

    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Another colleague with an A-level in biology (and a uni dropout) swore that women do not have gonads.

    That's possibly a vocabulary issue rather than a science one, but either way I'm not surprised he/she dropped out - we have some pretty dim students, and they tend to do that although sometimes they manage to stay on and get degrees.

    A colleague with a degree in chemistry from a respected university did not know what H2SO4 was.

    Maybe he used SO2(OH)2 as the formula - with a bit of organic background sometimes people get into the habit of using a formula which reflects some aspect of structure instead of just atom counts. But oil of vitriol is certainly diprotic acid so I guess the formula with H2 better reflects its behaviour in water.

    A friend with a doctorate in biology from one of the top five universities in the UK was useless at pub quizzes because the only subject she knew anything about was biology. Even then, she didn't know the difference between the terms "prokaryotic" and "eukaryotic."

    At first sight that seems odd in a biologist, but it is quite possibly the result of overspeciaisation - for example someone specialising in homeothermic vertebrates doesn't have to worry about whether or not the DNA is separated from the rest of a cell by a membrane, or indeed whether the DNA is structured into chromosomes, so termes like uekaryotic and prokaryotic and moneran are irrelevant to what they are doing and they can forget them. I've certainly forgotten some of the terminology of infinite set theory, despite still being a mathematician some of the time, simply because I don't do that stuff anymore - while countable infinite sets are quite useful in the maths of computation, I haven't yet come across a use in computer science for measurable sets or uncountable compact numbers.

    Several also expressed surprise when I was invited to join Mensa in the UK. They opined that if I was in the top 2% IQ-wise in the UK, I must be in the top 0.5% in the USA.

    They weren't very bright then, since there's no evidence that any of those fairly useless measures called IQ have different shaped distributions in the UK and in the USA. Anyway, in the UK mensa membership is about 0.035% of the poulation, in other words 98.25% of the people who qualify for membership don't join it (have more sense than to join it).

    FWIW, one of the smartest people I knew in the UK dropped out of a red brick then finished his degree at the Open University many years later. πŸ˜‰

    Certain redbrick universities have some pretty good drop-outs - I suspect that some of the more intelligent students drop out because the courses were so awful. The person you knew may have dropped out of a university where some of the courses are (a) very poorly taught and (b) almost content-free. In that case, well done him/her. The Open University appears not to have any courses like that.

    Tom

  • Sean Lange (6/5/2014)


    Luis Cazares (6/5/2014)


    Sean Lange (6/5/2014)


    Luis Cazares (6/5/2014)


    As most things, it depends.

    According to my education, America is a single continent divided in four regions: North, Central, South and Caribbean. According to the US education, North America and South America are 2 continents.

    Mexico is part of North America according to the usual concepts. But if you consider non political factors, it could be divided into North and Central America.

    To make everyone agree on whether there's one, two or three Americas is as difficult as making them to agree on the correct driving side of the road or to use decimal comma or decimal point.

    You are saying by US education we learn that there are 2 continents and that by your education you learned there are 2 continents. Yes, the US people also consider the North American continent to have the same four regions.

    If we start bringing political considerations into it, Texas is part of Central America, Louisiana is in France and California is on Mars.

    Nobody mentioned political anything, it was continents and no matter what education system you come from there are 2 American continents.

    I think that you missed my point. I learned that America is a single continent. But that might be wrong as I learned that Pluto was a planet.

    Wait a second...are you saying the Pluto isn't a planet??? LOL. OK I get what you are saying now. Boy this has been a conversation among the three of us with lots of confusion. :hehe:

    The great thing about continents is that they tend to be fairly large. I think that's all one can reliably say about them.

    As part of my education I learnt that a continent is a continuous stretch of land not separated into parts by sea or ocean.

    Another part was that North America and South America are two continents, and were two continents even before the construction of the Panama Canal (which isn't sea or ocean anyway). That wasn't too shocking, as Asia and Europe were also two continents despite not being separated by sea or ocean, and Africa too was a separate continent despite a continuous land connection to Europe and Asia (ignoring the Suez Canal, of course).

    Also that there were in all 3 American continents, called North America, south America, and - according to Richard Hakluyt's three volume tome entitled "The principal navigations, voyages, traffiques and discoveries of the English nation", published in 1600, the "large and fruitfull Continent of the West Indies" (someone else called it "the Caribean continent", but I can't trace the quotation) despite the West Indies being a lot of islands well and truly separated by ocean and sea from each other.

    I shall just ignore the definition of continent used by that extremely decent founding father, Gouverneur Morris, because there's already enough contradiction in the above without suggesting that the British colonies with their noundaries as at teh time of teh declaration of independence consituted a continent - obviously he ws using a different sense of the word.

    Being inclined towards mathematics and thus a great fan of Charles Dodgson I was never much bothered by the contradictions between the definition of "continent" and the actual naming of various geographical units as continents. Of course the continuous land not separated by sea definition is clearly broken, since none (or perhaps one - the antarctic continent) of the things that we call continents anywhere in the world are continents by that definition, but the extreme case (west Indies) is no longer called a continent by anyone so it would be quite easy to invent a new definition that fits current usage if anyone thought that definitions of words had to be what the words really mean.

    Tom

  • Koen Verbeeck (6/5/2014)


    I prefer the alias with the equal sign. It is very easy to align everything, especially when you have larger expressions.

    It's hard to believe this I know, but some people choose the horrible and hopelessly illogical alternative of hiding the most important property of the newly-named column - its new name - in a ragged right. I think someone at MS kicked this one off. Probably a cleaner πŸ˜€

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • TomThomson (6/6/2014)


    SQL is delicious (6/5/2014)


    TomThomson (6/5/2014)

    Having worked both in India with Indians and in American with Americans, I have to sort of agree with him - but his comparisons take it much too far. I regard an American bachelor's degree summa cum laude in many universities as roughly equivalent to British bottom-ranked university pass degree, and Indian degrees mostly fit somewhere in between. But things vary enormously between universities, and a good American university as about the same as a good British university - the problem with America is that it has a lot of poor universities (Britain has too, I think, but nowhere near as high a proportion as America, and maybe not now as opposed to in the past since things are thought to have impreoved here), not that it has no good ones.

    Interesting. I've lived in the UK before (2001-2007) and I kind of disagree with you about education. There's no denying that some American universities are little more than degree mills, churning out unprepared graduates. However, I've worked with many degreed/A-level qualified British professionals who claimed to know more than I did about...well...everything, because they had studied the subject "at uni" or held an A-level in that subject.

    An A-level is pretty meaningless unless it has a very high grade. People who think they know a subject because they have an A-level are idiots, and probably don't get a high A-level grade because if they did the would probably know enough about the subject to know they knew very little.

    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Another colleague with an A-level in biology (and a uni dropout) swore that women do not have gonads.

    That's possibly a vocabulary issue rather than a science one, but either way I'm not surprised he/she dropped out - we have some pretty dim students, and they tend to do that although sometimes they manage to stay on and get degrees.

    A colleague with a degree in chemistry from a respected university did not know what H2SO4 was.

    Maybe he used SO2(OH)2 as the formula - with a bit of organic background sometimes people get into the habit of using a formula which reflects some aspect of structure instead of just atom counts. But oil of vitriol is certainly diprotic acid so I guess the formula with H2 better reflects its behaviour in water.

    A friend with a doctorate in biology from one of the top five universities in the UK was useless at pub quizzes because the only subject she knew anything about was biology. Even then, she didn't know the difference between the terms "prokaryotic" and "eukaryotic."

    At first sight that seems odd in a biologist, but it is quite possibly the result of overspeciaisation - for example someone specialising in homeothermic vertebrates doesn't have to worry about whether or not the DNA is separated from the rest of a cell by a membrane, or indeed whether the DNA is structured into chromosomes, so termes like uekaryotic and prokaryotic and moneran are irrelevant to what they are doing and they can forget them. I've certainly forgotten some of the terminology of infinite set theory, despite still being a mathematician some of the time, simply because I don't do that stuff anymore - while countable infinite sets are quite useful in the maths of computation, I haven't yet come across a use in computer science for measurable sets or uncountable compact numbers.

    Several also expressed surprise when I was invited to join Mensa in the UK. They opined that if I was in the top 2% IQ-wise in the UK, I must be in the top 0.5% in the USA.

    They weren't very bright then, since there's no evidence that any of those fairly useless measures called IQ have different shaped distributions in the UK and in the USA. Anyway, in the UK mensa membership is about 0.035% of the poulation, in other words 98.25% of the people who qualify for membership don't join it (have more sense than to join it).

    FWIW, one of the smartest people I knew in the UK dropped out of a red brick then finished his degree at the Open University many years later. πŸ˜‰

    Certain redbrick universities have some pretty good drop-outs - I suspect that some of the more intelligent students drop out because the courses were so awful. The person you knew may have dropped out of a university where some of the courses are (a) very poorly taught and (b) almost content-free. In that case, well done him/her. The Open University appears not to have any courses like that.

    I'm not intending to slag off the British, I don't want anyone to get that impression. I also defend the UK's food on a regular basis...oddly, it's what I miss most about it! I miss milk, eggs, bread, meat, etc. that taste like actual milk, eggs, bread, and meat. Our bread here tastes like CAKE, it's gross. And nobody can touch the British when it comes to comfort food. They are masters at it. My oven here doesn't get hot enough to make proper Yorkshire puddings...how I miss those. πŸ™ And pressing the red button on my Sky remote when I'm watching Wimbledon on the BBC. I want my Sky box back!

    I think we are in complete agreement that there are idiots in both countries, and brilliant minds in both countries. Most people fall somewhere in-between. I consider myself part of the in-between, closer to "brilliant" than "idiot." πŸ™‚

    Regarding Mensa, I didn't actually join in the UK or the USA. I was having a crisis of confidence in myself at the time, so I took the test at my ex-husband's urging. He felt that I would do well enough to be invited to join and that it would give my confidence a boost. He was right on both counts. I had no desire to be a member of Mensa. And I know a lot of IQ testing is subjective, racially-biased, and a bit meaningless. But still, it felt nice to see my score and percentile in black and white. I won't lie. πŸ™‚

    As for my own education...I went to the University of Texas at Austin, one of the U.S.'s "public ivies" and the top public university in my state, both then and now. Admittedly, it was easier to get in 20 years ago than it is now. πŸ˜‰ I came out the other end four years later with a bachelor's degree in a liberal arts discipline. I don't "use" my degree in my career, but few people do. What my liberal arts education gave me was open-mindedness, resourcefulness, a love of learning, and a degree of intellectual flexibility that allows me to take what I've learned in one area and apply it to another. I focused on languages and applied linguistics and thoroughly enjoyed being a student. I studied what I loved. I didn't even know what a database was when I was a student. I don't regret it. πŸ™‚ However, I wouldn't recommend it to someone nowadays wanting to enter the I.T. field. The landscape has changed, and employers are much more picky about qualifications than they were when I entered the field in the late 1990s.

    When I lived in the UK, I lived in a uni city where one of the country's top universities was located. It was always in the top five unis in the country, sometimes in the top three. Most of the people I was friends with were affiliated with the uni in some way or had at least graduated from it. Many held advanced degrees. I know some unis in the UK are dropping the ball, but that particular institution is definitely doing it right. πŸ™‚

  • Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

  • gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (6/6/2014)


    gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    If x / 0 = infinity then does infinity * 0 = x?

    edit: I got the same explanation in college as gbritton1, "undefined".

  • patrickmcginnis59 10839 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    If x / 0 = infinity then does infinity * 0 = x?

    No, because you can't think if it as regular numbers. They are indeterminate forms, so they only make sense when looking at their limit forms. The crucial part is "in its asymptote".

    If you plot out y = x * 0, the result will always be 0. So for x going to infinity, the result will also be 0 in its asymptote.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (6/6/2014)


    gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    In the context of the conversation I was having with the colleague who told me it was possible (and appeared shocked that a calculator gave an "Err" response), I was pointing out to him that I saw potential for divide by zero errors in the functional spec that he wrote and was trying to make him aware that it would cause problems with the application. He denied that the application would error out under those circumstances.

  • SQL is delicious (6/6/2014)


    Koen Verbeeck (6/6/2014)


    gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    In the context of the conversation I was having with the colleague who told me it was possible (and appeared shocked that a calculator gave an "Err" response), I was pointing out to him that I saw potential for divide by zero errors in the functional spec that he wrote and was trying to make him aware that it would cause problems with the application. He denied that the application would error out under those circumstances.

    Are you really sure it was "Err" as in "Error" and not "Err..."?

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Koen Verbeeck (6/6/2014)


    patrickmcginnis59 10839 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    gbritton1 (6/6/2014)


    Koen Verbeeck (6/6/2014)


    TomThomson (6/6/2014)


    Just a couple of examples: A British colleague who held an A-level in math and a bachelor's in business swore you could, in fact, divide a number by zero and that my calculator must be wrong when I proved to him that you couldn't. He wouldn't take my word for it because according to him, "Americans are bad at maths."

    OK, he was an idiot. No-one claims that there are no British idiots.

    Technically, you can divide a number by zero. In its asymptote it approaches infinity, so you can baldly say that dividing a number through zero equals infinity. Calculators are just dumb things that can't display infinity, can you believe that?

    Technically? Not sure what that means. Division by zero is undefined in ordinary arithmetic and has no meaning.

    Technically means looking at mathematical theory.

    It is not undefined.

    If you take y:= f(x) = 1 /x and you plot it out on a graph, you can clearly see that for x going to 0 y is going to infinity.

    So you can say that in the asymptote of x->0, y equals infinity.

    If x / 0 = infinity then does infinity * 0 = x?

    No, because you can't think if it as regular numbers. They are indeterminate forms, so they only make sense when looking at their limit forms. The crucial part is "in its asymptote".

    If you plot out y = x * 0, the result will always be 0. So for x going to infinity, the result will also be 0 in its asymptote.

    You're saying that in the function f(x) = 1/x, as x approaches 0, f(x) approaches infinity. If you draw this curve, you can be drawing forever and this curve will not intersect with the vertical line that represents 0, although it can get arbitrarily close. X can be infinitely small, but with this curve, there will always be a value in between x and 0. There really is no value with this curve that says that x is infinitely close to 0 at the same time that says there is no value possible that x > value > 0. The only time that its impossible to say x > ? > 0, is when x is zero, but this curve approaches zero on the axis and never meets it, although it can get infinitely close πŸ™‚

    If I'm not mistaken, zero as a limit is still never zero by the very definition of "limit". Thats the impression I get when I google "divide by zero in calculus". But I'll admit that the given chances of me knowing more than you is also approaching zero but me being wrong rarely stops me from posting LOLOL

  • An expert converted our database from Access to SQL2000. We now have zip codes that are float, column names with spaces and #.

    One thing I do not like is people calling tables, databases. I can understand calling a column a field but it still gets me thinking.

    Given much of our code is pre semicolon, putting one before the WITH saves me thinking about putting on after the last statement. I am trying to break the habit but get lazy.:-)

Viewing 15 posts - 136 through 150 (of 272 total)

You must be logged in to reply to this topic. Login to reply