Hacker News new | ask | show | jobs
by yummyfajitas 4805 days ago
Tell me which is more likely to be a sum of profits for years since 2013. Excel:

    SUM(A100:A112)
SQL:

    SELECT SUM(yp.profit) 
          FROM yearly_profitability AS yp
          WHERE yp.year > '2012-12-31'::Datetime
(I'm forgetting how to do SQL datetimes, but whatever.)

SQL and other programming languages use words to describe the variables. Treating SQL like Excel would be DailyWTF material:

    CREATE TABLE sheet1(
      a  INTEGER,
      b  TIMESTAMP WITH TIME ZONE
    )
1 comments

I hate it when people generate these contrived examples where they intentionally stack the scenario to favour whichever way proves their point the most.

Which is easier to understand:

=SUM(profits01_2012:profits12_2012)

Or:

SELECT * FROM dassaddasads WHERE date > 1325394000 AND date < 1356930000

Which is easier to understand?!

I have seen literally hundreds of Excel spreadsheets from banks, consultancies, and VC firms and I have never, ever seen anyone name individual cells the way you are proposing here. If I had to name individual cells in a monthly model spanning the next 10 years over 250 line items, I'd quit that job.

I'm not saying that Excel can't do it, but a) it sounds like it would take a huge amount of time, so b) it is not practically done in "the real world."

If I had to name individual cells in a monthly model spanning the next 10 years over 250 line items, I'd quit that job.

Why would you quit the job over a few minutes of scripting with "WorkSheet.Names.Add"?

http://msdn.microsoft.com/en-us/library/office/ff835300.aspx

This ignores the common use case. yummyfajitas' examples were exceedingly stereotypical of both excel and mysql usage.
They aren't stereotypical of the kind of Excel that gets written by people who use it as a major part of their job. They're stereotypical of people writing poor Excel queries against unnamed cells via location reference.
Is that first one valid Excel? I've never seen it before.
Yes, it is valid Excel. Naming cells is something they teach in beginners courses.

http://www.computerhope.com/issues/ch000704.htm

http://support.microsoft.com/kb/274504