Note that there are some explanatory texts on larger screens.

plurals
  1. USxQbert
    primarykey
    data
    text
    <p>I am:</p> <ul> <li>SQL enthusiast </li> <li>Logical problem solver</li> <li>Data Miner</li> <li>SQL is like golf. You only have yourself to blame when you don't achieve the desired results.</li> </ul> <p>STEPS to Resolve a problem:</p> <ol> <li>Do something: anything along the vein of solving the problem that gets you to a resolution</li> <li>Review it and laugh (laughing is critical to alleviate the stress of solving the problem.</li> <li>Now do something right. Take ideas from the first attempt and use them to evolve a cleaner often simpler solution.</li> <li>Now make it better. Find inaccuracies; inefficiencies; or holes in the cleaner solution and develop a more robust, simpler and more accurate solution. Time doesn't always allow for step 4; but when it does it makes maintenance and future errors easier and less frequent.</li> </ol> <p>If you're new to SQL: I find the <a href="https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/" rel="nofollow noreferrer">venn diagram approach</a> very useful. It's by no means 100% accurate. Relationships and set based are similar; but not the same. See <a href="https://blog.jooq.org/2016/07/05/say-no-to-venn-diagrams-when-explaining-joins/" rel="nofollow noreferrer">Say no to venn diagrams when explaining joins</a> as to why.</p> <p>For those needing to ask a question consider <a href="https://blog.codinghorror.com/rubber-duck-problem-solving/" rel="nofollow noreferrer">talking to the duck first.</a> Yes, I'm serious. </p> <p>To generate a <a href="https://ozh.github.io/ascii-tables/" rel="nofollow noreferrer">nice table data for question</a></p> <p>For those proffering a solution be sure to <a href="http://rextester.com" rel="nofollow noreferrer">Test</a> it!</p> <p>Now, to <strong><em>inject</em></strong> some humor:</p> <pre><code>[SELECT userID FROM users WHERE Name = 'Robert');Drop table students; --Little bobby tables we call him.] </code></pre> <p>(<a href="http://xkcd.com/327/" rel="nofollow noreferrer">http://xkcd.com/327/</a>)</p> <p>I (not so recently) found an exchange in comments humorous: </p> <ul> <li>If you EVER need to do math on it, store it as a number</li> <li>If you'll NEVER do math on it store it as string</li> <li>If it needs to do both, you need two columns </li> <li>Except for dates... store dates as dates period and use date functions on them... not string {shudder} functions!</li> <li>and AutoIncrements can be numbers (though we should never do math on them)</li> </ul> <p>@xQbert -- this shall henceforth be referred to as "xQbert's razor"</p> <p>And because I'm lazy you may see this in several of my comments to help new members:</p> <p>SO is a great site to <a href="https://stackoverflow.com/help/how-to-ask">ask GOOD questions</a> and get answers: Just be sure to provide a complete <a href="https://stackoverflow.com/help/mcve">MCVE</a>. Before you ask a question consider <a href="https://blog.codinghorror.com/rubber-duck-problem-solving/" rel="nofollow noreferrer">talking to the duck first</a>. Yes, I'm serious! To help us help you, generate sample data and expected results. <a href="https://ozh.github.io/ascii-tables/" rel="nofollow noreferrer">ascii table</a> makes the output easy to read! You could also mock up data and the SQL tried using <a href="http://rextester.com/" rel="nofollow noreferrer">http://rextester.com/</a> or a similar site.</p>
    plurals
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload