Can You Copyright An SQL Query?

from the welcome-to-the-modern-world-of-ownership dept

Reader JohnForDummies alerts us to yet another example of extreme "ownership culture" found in a Stack Overflow query from a guy who works in IT for a school district. The school district needed to export a list of all its students every year to send to a company that handles their online exams -- and for years (before this guy was hired in IT), the district had contracted out the process to a guy who charged them $500 per year, to basically write and then run an SQL query that exported the data. Each year, all he had to do was change the date, but he still charged them $500. So the IT guy figures that he can change the date himself, but noticed that the contractor had put a nice copyright notice in the file:
// This code was writtend by [the guy]
// and is the property of [his company]...Copyright 2005,2006,2008,2009
// This code MAY NOT BE USED without the expressed written consent of
// [his company].
The Stack Overflow community basically suggested that the best course of action is to rewrite the query (even potentially asking the Stack Overflow community via a separate entry, with the details of what the query needs to do), but it does raise some basic questions about whether or not an SQL query can be covered by copyright. The answer, tragically, might be more complicated than it needs to be, but assuming that the query wasn't anything really out of the ordinary, it's difficult to see how a single SQL query, by itself, would be considered unique enough to be covered by copyright. However, I'm sure there will be differences of opinion here, so let's see if any of our copyright lawyer readership would like to weigh in on this one... As for the IT folks, it would be interesting to see what people think of the idea of copyrighting a single SQL query for something like this.
Hide this

Thank you for reading this Techdirt post. With so many things competing for everyone’s attention these days, we really appreciate you giving us your time. We work hard every day to put quality content out there for our community.

Techdirt is one of the few remaining truly independent media outlets. We do not have a giant corporation behind us, and we rely heavily on our community to support us, in an age when advertisers are increasingly uninterested in sponsoring small, independent sites — especially a site like ours that is unwilling to pull punches in its reporting and analysis.

While other websites have resorted to paywalls, registration requirements, and increasingly annoying/intrusive advertising, we have always kept Techdirt open and available to anyone. But in order to continue doing so, we need your support. We offer a variety of ways for our readers to support us, from direct donations to special subscriptions and cool merchandise — and every little bit helps. Thank you.

–The Techdirt Team

Filed Under: copyright, databases, it, schools, sql query


Reader Comments

Subscribe: RSS

View by: Time | Thread


  • icon
    Shawn (profile), 7 Dec 2009 @ 12:44pm

    from an IT side I would act like the parser and ignore any statement preceded by //

    link to this | view in chronology ]

  • icon
    Designerfx (profile), 7 Dec 2009 @ 12:58pm

    legally

    I imagine this is quite a legal grey area, but only because it's probably not been debated a lot. However, the developer isn't as much a douchebag as his company is, really. This is like when a lawyer tries to claim copyright of their DMCA notices.

    Oh, and facts aren't copyrightable, no? Thus, how can a SQL query be anything but a fact to a point.

    link to this | view in chronology ]

    • identicon
      Kaz, 7 Dec 2009 @ 1:01pm

      Re: legally

      You mean point to a fact?

      Wouldn't modifying be a derivative work?!?!

      link to this | view in chronology ]

      • icon
        Tor (profile), 7 Dec 2009 @ 1:09pm

        Re: Re: legally

        "Wouldn't modifying be a derivative work?!?!"

        Not if the original piece of information is not a work protected by copyright.

        link to this | view in chronology ]

        • identicon
          Kazi, 7 Dec 2009 @ 1:27pm

          Re: Re: Re: legally

          But assuming it's to hard to figure that out ... can it be considered a derivative work?

          link to this | view in chronology ]

      • icon
        Designerfx (profile), 7 Dec 2009 @ 1:14pm

        Re: Re: legally

        no, I missed a comma. "how can a sql inquiry be anything but a fact, to a point".

        link to this | view in chronology ]

    • identicon
      IP Law Student, 7 Dec 2009 @ 6:21pm

      Re: legally

      this is not a legal gray area, and you cannot copyright functionality.

      it is called "merger doctrine."

      link to this | view in chronology ]

  • identicon
    oih GOD ENOUGH, 7 Dec 2009 @ 1:16pm

    ENOUGH

    this retarded anal obsession with control has to fraking end
    im serious if it were MS would make a program otmake every known possible query and POOF no more free mysql
    and then the gpl2 guys would be suing MS for infringing on the USE and distribution of a gpl2 work
    YOU CANT COPYRIGHT IT NERDS , IT ALREAD HAS A LISCENCE
    GPLv2

    link to this | view in chronology ]

    • identicon
      DS, 7 Dec 2009 @ 2:56pm

      Re: ENOUGH

      Good thing posting babbling nonsense is not copyrighted.

      link to this | view in chronology ]

      • icon
        Hephaestus (profile), 8 Dec 2009 @ 6:07am

        Re: Re: ENOUGH

        I understand what he is saying... or rather trying to say ...

        If you write a routine to produce every conceivable SQL query and GPL2 each one of the routines. Problem solved... or rather thats my intepretation of that caffine or alcohol based rant...

        link to this | view in chronology ]

  • identicon
    pegr, 7 Dec 2009 @ 1:17pm

    For the answer, be sure to ask the right question

    The question is really this: Is a single SQL query sufficiently creative to be copyrighted? Remember, only creative expression can be copyrighted. If there is nothing especially creative, that is, if a reasonbly competent DBA would come up with the same query as the original, then I would argue that it is insufficiantly creative to be copyrightable.

    link to this | view in chronology ]

    • identicon
      IP Law Student, 7 Dec 2009 @ 6:22pm

      Re: For the answer, be sure to ask the right question

      That is not the question. "originality" is de minimis. the issue is whether functionality is merged with fixation, which it is.

      link to this | view in chronology ]

  • icon
    dwind (profile), 7 Dec 2009 @ 1:18pm

    Isn't code copyrighted?

    The companies I've worked for had comments in every module saying the code was copyrighted.
    How is this different from an sql query?

    link to this | view in chronology ]

    • identicon
      Anonymous Coward, 7 Dec 2009 @ 1:24pm

      Re: Isn't code copyrighted?

      The companies I've worked for had comments in every module saying the code was copyrighted. How is this different from an sql query?

      Way to miss the point of the discussion, jimbo.

      link to this | view in chronology ]

      • icon
        nasch (profile), 7 Dec 2009 @ 2:42pm

        Re: Re: Isn't code copyrighted?

        Care to elaborate? SQL queries are instructions to a database engine. Computer code is instructions to a computer, interpreter, or virtual machine. Why would one be copyrightable and not the other? Is it the size of it? The obviousness? That there is no other reasonable way to perform this operation other than by the query in question?

        link to this | view in chronology ]

  • identicon
    RD, 7 Dec 2009 @ 1:23pm

    The Pro-IP whinefest

    Of COURSE they are, Mike! Dont you know? EVERYTHING is OWNED now, under copyright law. There are NO original ideas, and EVERY use MUST be a PAID USE! It's ILLEGAL otherwise! If you use it, and you didnt pay for it, ITS ILLEGAL! If you create ANYTHING, and just thinking of it IS creation, ITS COPYRIGHT AND ILLEGAL TO USE WITHOUT PAYING FOR! If you create ANYTHING that has even a TINY SHRED of something that might have already been created, you are GUILTY! You are guilty if you create or consume copyrighted works without proper payment! Its an INHERENT RIGHT built in to the very UNIVERSE ITSELF!!!

    link to this | view in chronology ]

  • identicon
    RD, 7 Dec 2009 @ 1:29pm

    Airplane-over-the-headTard(tm)

    "The companies I've worked for had comments in every module saying the code was copyrighted. How is this different from an sql query?"

    OH yes! Because the copyright of the ENTIRE CODE OUTPUT of your ENTIRE COMPANY is the equivalent of a SINGLE LINE of SQL code! Right! How could we be so foolish as to be discussing this at all?

    'Tard

    link to this | view in chronology ]

  • icon
    PopeHilarius (profile), 7 Dec 2009 @ 1:29pm

    SELECT entitlement.waste_of_everyone's_time

    FROM Pointless.Legal entitlement

    WHERE net_societal_gain = 0

    link to this | view in chronology ]

    • identicon
      dan, 7 Dec 2009 @ 1:48pm

      Re:

      I hope you claim ownership to that. Defiantly has more merit then what the article is about.

      link to this | view in chronology ]

    • identicon
      DS78, 7 Dec 2009 @ 2:26pm

      Re:

      Server: Msg 105, Level 15, State 1, Line 1
      Unclosed quotation mark before the character string 's_time
      FROM Pointless.Legal entitlement
      WHERE net_societal_gain = 0

      link to this | view in chronology ]

      • identicon
        Anonymous Coward, 7 Dec 2009 @ 2:52pm

        Re: Re:

        SELECT Pointless.'legal entitlement'.waste_of_everyone's_time

        FROM Pointless.'Legal entitlement'

        WHERE Pointless.'Legal entitlement'.net_societal_gain = 0

        Just goes to show that there really is only ONE way using SQL get specific data from a specific database in a specific format. Once that way is copyrighted, all databases EVERYWHERE are rendered useless.

        link to this | view in chronology ]

        • identicon
          DS78, 7 Dec 2009 @ 4:35pm

          Re: Re: Re:

          Sorry AC, this revision is worse than the original. Single quotes are parsed as containing a string.

          SELECT pointless.waste_of_everyones_time
          FROM legal_entitlement pointless
          WHERE pointless.net_societal_gain = 0;

          Try this on for size, semi colon optional depending on the tool you're using. In this instance I chose to use an underscore to replace spaces in the field names. Otherwise you might use square brackets around field names that contain spaces.

          Did I just violate the copyright (if any) of the original query or does this count as a derivative work?

          link to this | view in chronology ]

  • icon
    Yano (profile), 7 Dec 2009 @ 1:38pm

    SQL query code isn't actual code it doesn't create anything it just away to interact with the database, so copyrighting an SQL query is the GUI equivalent of copyrighting the way you drag-and-drop, it's ridiculous.

    link to this | view in chronology ]

    • icon
      senshikaze (profile), 7 Dec 2009 @ 1:46pm

      Re:

      wouldn't that be a patent?

      link to this | view in chronology ]

    • icon
      nasch (profile), 7 Dec 2009 @ 2:45pm

      Re:

      What do you mean, doesn't create anything? A SQL query is a way to interact with a database engine. Javascript code is a way to interact with a browser. Java code is a way to interact with a Java virtual machine. What makes one of those subject to copyright and another one not?

      link to this | view in chronology ]

    • identicon
      Anonymous Coward, 7 Dec 2009 @ 2:59pm

      Re:

      Oh, you are so wrong. SQL = Structured Query Language. It's a programming language like any other with the exception that it's specifically for databases. If you think that SQL statements don't create anything, then you've obviously never worked hard to create a complex and powerful query that selects/inserts/updates data in a database.
      Having written some doosies in my time, believe me I'd LOVE to be paid $500 every time someone ran the query, but that's just not how it works. Otherwise, all databases would become prohibitively expensive to run and therefore useless.

      link to this | view in chronology ]

  • icon
    Ben (profile), 7 Dec 2009 @ 1:41pm

    work for hire?

    I'm sorry but it seems strange on a number of levels, but the one which hits me is that this guy was hired to create the query as a contractor (sorry, that may be an assumption, but it seems likely). Unless outlined in whatever contract he may have had to the contrary, his "creation" comes under "work for hire" and is owned by the employer; you can _SAY_ your work is copyrighted and use is restricted, but that doesn't actually make it so.

    link to this | view in chronology ]

    • identicon
      Anonymous Coward, 7 Dec 2009 @ 1:52pm

      Re: work for hire?

      ding ding, we have a winner...

      link to this | view in chronology ]

    • icon
      Phillip (profile), 7 Dec 2009 @ 2:08pm

      Re: work for hire?

      we had some similar things on a project I worked for.
      The code was developed with money from the customer and our own company so they had joint ownership.

      The customer could use it for anything they wanted, but we had the rights to sell the code.
      It still had copyright notices in there, but the customer didn't have to pay any attention to them as long as they weren't selling it.

      link to this | view in chronology ]

    • identicon
      IP Law Student, 7 Dec 2009 @ 6:23pm

      Re: work for hire?

      link to this | view in chronology ]

      • identicon
        IP Law Student, 7 Dec 2009 @ 6:24pm

        Re: Re: work for hire?

        The opposite is true. Unless the contract specifically states that it was a work for hire, it isn't.

        See, generally, 17 USC 101, 17 USC 204, Aalmuhammed v. Lee.

        link to this | view in chronology ]

    • icon
      vilain (profile), 7 Dec 2009 @ 6:56pm

      Re: work for hire?

      Yep. I'd start by getting a lawyer to review the contract the guy signed who created the code. Most contracts I've signed (employment or contractor) have verbage saying that any code or "product" I produce while working for the contractee is their property. It's most likely that header is an utter fiction. If the guy litigates, take his house, car, salt his fields and rape his cattle.

      link to this | view in chronology ]

  • icon
    senshikaze (profile), 7 Dec 2009 @ 1:45pm

    As a (bad) db admin, I would have to say it shouldn't be.
    The biggest question is: If I have a sql select statement "SELECT * FROM students"(basically the simplest select query I can think of), which means "get all data in table students", and declared a copyright on it, what am I copyrighting? If Susie's table just so happens to be "students" then she is now in violation. You can't make an original sql statement. Everything is built off a statement from somewhere else(I get alot of my complicated ones from the MYSQL user docs).
    I would have to agree with Shawn up top and completely ignore the copyright notice and then delete it.
    This does bring up another question though: what are other software copyright's covering? Without being able to see the code how do I know my snippet of code that runs a loop over a config file isn't an exact copy of another person's code? It isn't impossible to imagine that quick and easy ways to do somethings in a programming language are going to be pretty obvious to anyone working on a program in said language. things to ponder...

    link to this | view in chronology ]

  • identicon
    Don, 7 Dec 2009 @ 1:46pm

    Regardless of whether the query is the intellectual property of the writer, it would in a sense become something completely different once the identifiers and table names are changed.

    ;

    link to this | view in chronology ]

  • identicon
    Thomas O'Toole, 7 Dec 2009 @ 1:50pm

    merger doctrine

    Section 102(b) of the Copyright Act states that "[i]n
    no case does copyright protection for an original work of authorship extend to any idea, procedure, process, system, method of operation, concept, principle, or discovery,
    regardless of the form in which it is described, explained, illustrated, or embodied in such work.”

    Under Section 102(b), the expression of the idea is protected, not the idea itself.

    Copyright law has a closely related rule called the “merger doctrine,” which states that where an idea and its expression are inseparable (an idea that can be expressed in only one way) then there can be no copyright protection for the expression.

    For example, Robert Johnson is entitled to a copyright on Kindhearted Woman Blues (his expression of the 12-bar blues idea), but not on the 12-bar blues itself.

    In the case of an SQL query, I think it would be very difficult to obtain copyright protection for this query, which merely appears to select a recordset and export it. However ... if in fact there are many ways to select a recordset and this programmer's code expressed an original way of doing so, then maybe it is a closer case.

    link to this | view in chronology ]

  • icon
    slacker525600 (profile), 7 Dec 2009 @ 1:54pm

    I wasnt going to comment, but

    a few things.
    First off, I know I shouldnt feed the trolls, but "every known possible query" is an infinite set. Thats computation theory, SQL is a language, its capable of doing a lot (or at least all the real world implementations of it).

    Secondly. "is the equivalent of a SINGLE LINE of SQL code!" I havent seen any indication that this is one line of code. From the stack overflow comments it appeared that they IT guy was afraid to copy any of it based on the copyright notice. Ive seen data exports that take 5 seconds to write "select * from table_name" and Ive seen ones that take 100 hours, where the data needs to be formatted in some ridiculous manner, and there are massive tables of information and the database has been created without reasonable keys, just an example of minor things that could take time to overcome.

    Basically the question I would ask comes down to is similar to an above post "Is a single SQL query sufficiently creative to be copyrighted? " but replacing the a with this. Is this query significantly complicated. In that post the point of "if a reasonbly competent DBA would come up with the same query" it shouldnt be copyrightable. But, anybody who has ever spent money on a database expert knows that their fees are generally ludicrous (although the real experts are fine tuning things based on oracle internals to shave off milliseconds in ridiculous ways).

    Thirdly, this is most likely just a business decision. It is possible that the company spent more than 500 dollars of resources the first year trying to get this export working to the school's standards, and that the school refused to pay the overage charges, and as a way to recoup in subsequent years the company simply continued to bill 500 each year. I dont know, but I think this is entirely possible and it makes the actions less evil and more an attempt at getting back to even on the transaction.

    link to this | view in chronology ]

    • icon
      Phillip (profile), 7 Dec 2009 @ 2:11pm

      Re: I wasnt going to comment, but

      if he went over he should have never accepted the work or not accepted it without something in the contract pertaining to how many hours that work was for and what to do if he went over.
      Most likely they said we will pay you $500.00 to write this code. They don't care if it takes 10 seconds or 200 hours they're paying you to get it down by a certain date. If you can't do it for that price you're an idiot to accept the work.

      link to this | view in chronology ]

  • identicon
    JJ, 7 Dec 2009 @ 2:06pm

    no way

    this guy can't sell this i assume he doesn't have rights to sell it from MS. Every enterprise software i've deployed has specific language in the ToS, EULA or License contracts that do not allow you to copyright their IP by leveraging their tools/software.

    link to this | view in chronology ]

    • icon
      nasch (profile), 7 Dec 2009 @ 2:49pm

      Re: no way

      You may be thinking of Microsoft SQL Server? That is a particular database engine. The subject of the story is a bit of SQL, or Standard Query Language. Database query code, not a database program.

      link to this | view in chronology ]

  • identicon
    Caleb, 7 Dec 2009 @ 2:08pm

    I just copyrighted "SELECT *". Checks better be in the mail, bitches.

    link to this | view in chronology ]

  • icon
    Michael (profile), 7 Dec 2009 @ 2:10pm

    another IT folk weighing in...

    After writing SQL for 16+ years now, I am going to say in general, no. Even though I have written some really elegant, really complex queries, NO. Not worth copywriting. Could it be? Maybe. I have my doubts a single query having enough uniqueness to even merit a copyright. Databases change if not get outright replaced pretty quickly. As do queries to maintain the data.

    If we were talking database schemas I would be more inclined to yes. Still database queries and schemas aren't really great products on their own. So copyright of them would be mostly bullshit IMO. Sell complete product then copyright.

    The author of the said query was performing a service...can you copyright that??? Ugh.

    link to this | view in chronology ]

  • identicon
    Anonymous Coward, 7 Dec 2009 @ 2:11pm

    If people can copyright 4 minutes and 33 seconds of silence, then why not an SQL query?

    link to this | view in chronology ]

  • icon
    Overcast (profile), 7 Dec 2009 @ 2:25pm

    It would be like copyrighting a batch file - or directions to a business.

    It's just a series of commands/strings/parameters in a row.

    link to this | view in chronology ]

  • icon
    Devin Moore (profile), 7 Dec 2009 @ 2:31pm

    Copyright law

    Apparently there's a giant rift that has opened up between "what everyone wants copyright to mean" and "what copyright actually means". If you wrote something yourself, it is automatically copyrighted. A copyright refers to your right to protect something you wrote as your own, meaning someone else cannot just take your work and call it theirs. Moreover, they cannot reproduce the work that you made by taking it from you without your permission. Does this entitle you to royalties? Only if you get them to agree to sign a contract for royalties. If they don't sign and you don't want to give them your work, they do not have the right to take it. Them's the breaks, folks. Of course, they can always come up with their own version of whatever it is (a copyright is not a patent). As long as they didn't take yours, your copyright is protected.

    If you sign a work contract or are employed to produce creative works, you will have trouble asserting a separate copyright contract against your employer for works created while "on the clock" and with company resources. However, this doesn't mean that your copyright is not still there. I have signed these types of contracts in order to hand over copyright on certain very specific things, so that implies that without the contract, I could still lay claim to those things. (It almost certainly wouldn't be worth the legal costs unless millions of my money were at stake).

    Copyright does not mean that someone can write "select *" (this is not a valid SQL query anyhow) as this would likely fall under the exemption made for titles. Just as you cannot copyright the title to a book, you probably cannot assert a copyright over a single, uncreative sentence. Yes, creativity is objective enough that in any legal case, some "crappy" poem will still hold up as "creative" while "select *" will not. The purpose of copyright is not to prevent anyone from using some phrase (that's a trademark) but foremost copyright is to protect published works that are generating lots of money from being ripped off and stolen from their creators, with no compensation to the creator for their work.

    Copyright doesn't apply to creatively "transformed works", especially if attribution is already given and the transformations noted. So, if you take a massive SQL query and have to apply a creative new fix to it for something, your new version qualifies for its own copyright separate from the original copyright. That's right, now there are two copyrights: the one for the original author on the original work, and your new copyright on the "creatively transformed work". Creative transformation only applies in the case of a reasonable-sized transformation, meaning you can't just paraphrase someone, that's still plagiarism.

    http://www.copyright.gov/

    link to this | view in chronology ]

    • icon
      nasch (profile), 7 Dec 2009 @ 2:53pm

      Re: Copyright law

      The purpose of copyright is not to prevent anyone from using some phrase (that's a trademark) but foremost copyright is to protect published works that are generating lots of money from being ripped off and stolen from their creators, with no compensation to the creator for their work.

      No, it is not. The purpose of copyright is to promote the creation of new works. Ensuring monopoly reproduction rights is the means by which it (supposedly) does so.

      link to this | view in chronology ]

  • icon
    Marcel de Jong (profile), 7 Dec 2009 @ 2:36pm

    Brilliant!

    I'll just copyright SQL injection code, and I'll be rich!

    link to this | view in chronology ]

  • icon
    Overcast (profile), 7 Dec 2009 @ 2:37pm

    Actually - it says it was written for Sybase..

    This is in their EULA:

    "3. COPYRIGHT AND OWNERSHIP. The Program is owned by Sybase, its subsidiaries or their suppliers and are protected by copyright laws and international treaty provisions. You acquire only the non-exclusive right to use the Program as permitted herein and do not acquire any rights of ownership in the Program or any other implied rights or licenses under any intellectual property rights of Sybase."

    So he didn't OWN the SQL code to copyright it, correct? He was just 'licensed to use it'. If I would interpret that right.

    link to this | view in chronology ]

    • icon
      nasch (profile), 7 Dec 2009 @ 2:55pm

      Re:

      It looks like you have pasted a section of the EULA for the Sybase database engine? The SQL query he has written is not part of that codebase, so that EULA and copyright does not apply.

      link to this | view in chronology ]

  • icon
    Laughingdragon (profile), 7 Dec 2009 @ 3:07pm

    Copyright, work for hire, and SQL

    This guy is writing code for cash. It's a work for hire and he doesn't own it so he can't copyright it.

    Also, the programmer doesn't own or have claim to have use of the fieldnames, tablenames or any other part of the database. So, he can't copyright those parts of his code. ..Even if he weren't working as work for hire but had created a code package to sell to the company.

    Additionally, SQL code is limited by it's rules of syntax. Much as titles of books cannot be copyrighted, a code module is probably not copyrightable because there may be only one to a few ways to efficiently phrase a routine. One might be able to copyright a program, in total. But not be able to copyright a component piece.

    link to this | view in chronology ]

  • identicon
    mischa, 7 Dec 2009 @ 3:14pm

    You shouldn't be able to copyright an SQL statement. As far as I'm concerned, that wouldn't be any different than copyrighting the answer to a math question. While there might be more than one way to write the actual SQL, it is still the same answer. i.e. (a+b)+c = a+(b+c)

    link to this | view in chronology ]

  • icon
    tracker1 (profile), 7 Dec 2009 @ 3:20pm

    Why shouldn't SQL be copyrightable?

    If this piece of SQL (A script for all intents and purposes) isn't copyrightable, then what is?

    It's code meant to be compiled/parsed and executed by a computer. By the same logic as some here *NO* code can be under copyright protection (including GPL code). To be honest, it's pretty silly, but depends on the script in question.

    If it's a fairly simple select statement, than no way... if it's a set of commands, and/or a sproc, then who knows. It's pretty gray afaik. And probably depends on the structure itself.

    link to this | view in chronology ]

  • icon
    Norm (profile), 7 Dec 2009 @ 3:46pm

    But who owns the SQL statement?

    The referenced article doesn't have many specifics, but one question that most people here missed is "Who owns the statement?". If the company hired the contractor for work, shouldn't the company own it and not the contractor? I suppose if there was a contract involved that specifically stated "The contractor retains rights on the work produced" this might make sense (disregarding the copyright question). Otherwise, the contractor has already sold the coyright to the company, which means that the copyright statement in the file is legally useless. Honestly, if the above statement did exist in some form, the contractor should have never been hired in the first place.

    link to this | view in chronology ]

  • identicon
    Anonymous Coward, 7 Dec 2009 @ 3:48pm

    Mike, I noticed you copied this one from the IT section, I guess you are having a hard time getting anyone over there to comment.

    Actually, the code is poorly written, and for the price of $500, the guy who wrote it should be told to make the date field easy to change legally, or they will replace the code outright.

    He's being greedy, that isn't the intent of copyright, but it is also whoever hired him's fault for not fixing this one years (and about $3000) ago.

    link to this | view in chronology ]

  • icon
    N.Olsen (profile), 7 Dec 2009 @ 4:35pm

    Can't copyright facts...or math?

    I'm fairly certain that I've heard Mike discuss why you can't patent math...or science...or facts...multiple times on here.

    As SQL is a methodology for doing set-theory (mathematics), you'd basically be copyrighting facts.

    Just because a company *says* (or *thinks*) it has a copyright on something doesn't make it so. That sounds like typical IT boilerplate, left for the sole purpose of intimidation.

    To quote an un-remembered CS Professor: Plagiarism is for English Class.

    The point being that the "art" of Programming is being able to see how all the bits fit together and interoperate, not the exact code. Anyone can C-C-P their way through code, but a real Programmer knows the how's and why's.

    link to this | view in chronology ]

  • identicon
    NullOp, 7 Dec 2009 @ 5:02pm

    Copyright?

    Yeah, it's copyrightable. The big question is, however, is the guy willing to defend the copyright. If it were me, I would just rewrite it in a slightly different way if possible. If not, screw 'em. Two hours with any lawyer is gonna kill $500 bucks easy! It ain't worth it.

    link to this | view in chronology ]

  • identicon
    Theranos, 7 Dec 2009 @ 5:06pm

    Honestly, depending on what the current copyright laws are, he probably has a right to "copyright" it and did so by issuing the notice. Now that only copyrights that instance per say that if someone can come up with the same code via original work, then technically they can use it for their own works. That said, it does show the great issues with many copyright laws by allowing for the copyright of one thing that can be recreated through original process several times over. It's good that this is just a copyright and not an attempted patent, as a patent would raise ten times the alarms of what the hell is going on...

    link to this | view in chronology ]

  • identicon
    Anonymous Coward, 7 Dec 2009 @ 5:11pm

    Some people have mentioned that SQL does not create anything, this is not correct. SQL can and is used to create/modify/drop tables and schemas which are a part of a database design which I can see being reasonably subject to copyright. As for a single query to take data from a table or series of tables to create a report, I'm not sure that this is the definition of a code segment that would be subject to copyright.

    link to this | view in chronology ]

  • identicon
    IANAL, 7 Dec 2009 @ 5:51pm

    yes and no

    I suppose that one could copyright the greeting "Hello", but that does not mean they will be able to enforce it. Most courts would throw that out the door, possibly with a fine to boot and rightfully so.

    link to this | view in chronology ]

  • identicon
    Tank, 7 Dec 2009 @ 6:09pm

    What Question

    As of this posting i am at the Ballmer Peak (Google XKCD and Ballmer Peak). IMHO I think that aside from all of the programmatic questions, statements and verbal lashings is the fundamental question: and that is, can you copyright a question? This is essentially what is being stated as being copyrighted (disclosure, Newbie SQL player). As i understand from all that is available and from my own limited knowledge the contractor formulated a question to a DB with a specific format to the answer. How is this any different than say.. a Defense attorney asking a witness a question in a trial but stating that the witness can only answer yes or no or true or false (another disclosure, i used to watch tons of Law and order!) but seriously how is it any different? if this was a SQL statement to modify the DB and not a Query it might hold (a very, very small amount) of water, but it is not. It is a question to a computer looking for an answer in a desired format. I am no expert on any of these topics, but I have been a loyal reader for over five years and I don't see how it should be possible to copyright a question, although it may well be quite possible. Now, to really bake your noodle (Matrix) could this also be construed (very disgustingly) as a derivative work since it is almost identical to say...an answer key? Fundamentally i would say yes. (http://www.techdirt.com/articles/20091030/1549296745.shtml)
    where is the difference but where is the sense? It is a pickle no doubt about that.

    link to this | view in chronology ]

    • icon
      senshikaze (profile), 8 Dec 2009 @ 5:13am

      Re: What Question

      a SQL statement isn't a question though.
      a select statement means "Give me X from Y where Z=A"
      That is not a question. It can be worded as a question, but the sql statement itself is a statement.

      All in all, I do think that you can copyright a SQL, but you shouldn't. It is not like you could enforce your copyright anyway, most of the time, sql statements are completely hidden from the user, and unless this guy/company wants to go toe to toe with oracle, microsoft, or sun, they could never get any money from their "copyright".
      So yes, a SQL statement is copyright-able, but that doesn't mean a damned thing in the real world.

      link to this | view in chronology ]

  • identicon
    Anonymous Coward, 7 Dec 2009 @ 6:38pm

    I'm copyrighting this query:

    SELECT * FROM public.*

    Every other query ever to be written will be a derivative work and will require payment of licence fees.

    link to this | view in chronology ]

  • identicon
    Lawrence D'Oliveiro, 7 Dec 2009 @ 9:11pm

    SQL Is A Programming Language

    Since it’s a programming language, instruction sequences you write in it are no more or less copyrightable than instruction sequences written in any other language. Like any other language, you can write short, trivial things in it, and you can write long, complicated things in it.

    for entry in SQLIter
      (
            "select clients.client_id as client_id, jobs.job_id as job_id,"
            " clients.name as client_name, jobs.description as description, hours.from_time as from_time,"
            " hours.to_time as to_time, hours.notes as notes from"
            " clients inner join jobs on clients.client_id = jobs.client_id inner join hours on jobs.job_id = hours.job_id where"
            " hours.from_time >= %(after)u and hours.from_time hours.from_time < %(before)u and hours.to_time is not null"
        %
          {
            "after" : day_local_start(when_worked),
            "before" : day_local_start(when_worked + 1),
          },
      ) :
    ...

    link to this | view in chronology ]

  • identicon
    Doctor Strange, 7 Dec 2009 @ 9:40pm

    There are two questions here. The first is whether a (possibly simple) SQL query is sufficiently original to be copyrightable; the second is whether it SHOULD be. I am sure that everyone has their opinion on the second. However, in the real world, the OP needs only be concerned with the first.

    With respect to the first, then, the Software Freedom Law Center opines:

    The originality requirement under both U.S. and E.U. copyright law is minimal, such that courts have ruled computer programs insufficiently original to be eligible for copyright protection in only a very small number of cases. While the originality standard is low, it does exist. In particular, the laws stress that it is a programmer’s expression of some functionality that may be protected by copyright, and not the functionality itself. If code embodies the only way (or one of very few ways) to express its underlying functionality, that code will be considered unoriginal because the expression is inseparable from the functionality. Similarly, if a program’s expression is dictated entirely by practical or technical considerations, or other external constraints, it will also be considered unoriginal.


    With the standard for originality so minimal, it's likely that this query (even if simple) is copyrightable. Either way, although without the query we can't say for sure, one of two things is likely to be true:

    1. The query was so dirt-simple that there was basically no other way to do it, and therefore might be unoriginal and thus uncopyrightable; or

    2. The query was complex enough to be original and copyrightable.

    In the case of #1, if you were at all interested in just solving the problem, you would close the query and rewrite it yourself from scratch in the ten seconds it took to do so. If you were especially paranoid, you would call or email your buddy (i.e., anybody who has more than five minutes' experience with a database) and have him or her write the query for you cleanroom-style, to avoid any possible appearance of impropriety.

    Since the original poster did not do this, it's unclear that #1 is the case. In the case of #2, then, you would pull the guy's employment contract and see what the provisions were with respect to work-for-hire. Maybe the development of the query was work-for-hire, in which case you have no problem. Maybe you got a non-exclusive license to use the code and create derivative works, in which case you still don't have a problem.

    Maybe, however, whoever wrote the contract just let the contractor keep his code, with the licensing terms left out, unclear, or imprecisely stated. In this case, you first go find whomever wrote the contract and beat them about the head and neck. Then, you do one of the following:

    - Rewrite the query yourself from scratch.

    - If more paranoid, pay your buddy to write you a clean-room implementation of the (more complex) code as work for hire.

    - Change the code and use it anyway, claiming fair use.

    - Renegotiate the license with the original contractor.

    link to this | view in chronology ]

    • icon
      Nick Coghlan (profile), 8 Dec 2009 @ 12:59pm

      Re:

      I was going to write an "It depends" comment (since I hadn't seen a good one aside from the brief FSF quote), but fortunately I read as far as this comment from "Doctor Strange" first. It covers the different possible situations really well.

      In other contexts (usually free speech ones with companies attempting to ban distribution of things like DeCSS), you will see the idea of "code is speech". Just as some written speech is too trivial to be effectively copyrighted, so it is with code. But once the complexity and originality reaches a certain level, then claiming copyright is justifiable.

      The difference between this and patents (and the reason it doesn't outrage most programmers anywhere near as much) is that with copyright, independent invention *is* permitted, so onerous licensing terms (such as these) are vulnerable to being undercut by a "clean room" reimplementation. As Dr Strange notes though, it may be a bit legally questionable getting someone that has seen the original query to do the reimplementation - from a legal point of view, it would be safer to get an untainted programmer to do it (although $500 a year isn't enough money to justify much of a lawsuit, so it may not be worth worrying about that).

      link to this | view in chronology ]

  • icon
    PrometheeFeu (profile), 7 Dec 2009 @ 9:43pm

    I think it could reasonably be argued that SQL queries are all so similar to what is found in the SQL documentation that they are derived works of that documentation or any number of tutorials out there. Writing a SQL query can be a pain but it is not in my books (and I have been writing SQL queries for close to a decade) a process which involves the slightest amount of creativity. An exception could be made I suppose for queries that create functions etc... I would like to add, that I will write that query and license it to the school under the BSD or MIT license for $100 if they want. Though I'm sure there are plenty of people out there willing to do it for free...

    link to this | view in chronology ]

  • icon
    R. Miles (profile), 8 Dec 2009 @ 3:49am

    Wow. I just went back to 1999!

    I haven't seen a copyright statement in code in a very, very long time and I'm completely stunned there are some who still use this "warning".

    When the internet started taking off, this type of thing was so commonplace. People thought, incorrectly, they could "copyright" software. I can't count the number of times I saw a copyright notice.

    To those who think you can copyright software, a caveat warning before you rush to say "Hell ya!": 100% of the learning you received was by code someone else wrote which, for the most part, you did not pay for.

    Google allows open access to anyone who takes the time to teach others how to code.
    Now, those articles are copyright, but certainly not the code examples within them.

    But I digress, here. I know people will challenge this because they feel they're entitled to more money than the salary they're being paid to write the code to begin with.

    I can see why the "codewriters" feel this way, given songwriters carry the same "boo hoo" tune when others make more off their "hard work" (laughable) than their salary did.

    Salary. Interesting word that never appears when discussing copyright. Why is that?

    link to this | view in chronology ]

    • icon
      senshikaze (profile), 8 Dec 2009 @ 5:15am

      Re: Wow. I just went back to 1999!

      um... as much as i hate it, people can copyright software under most countries' law.

      link to this | view in chronology ]

  • identicon
    DB, 8 Dec 2009 @ 6:24am

    Thanks, Doc, & My Look at the Practical

    About two of the posts accurately analyzed the issue, the last being Doctor Strange. So here's my take: (1) if it's an original work it's probably copyrightable, so (a) if the programmer wrote it from scratch, or wrote it with permission, it is probably copyrighted; (2) it can't be enforced until there is a registration so (a) the programmer has to pay the registration fee and (b) submit a "deposit"; (c) if no deposit, then no registration (if this "work" is on the school's computer only, how's he going to get it?); (3) if it's not registered already, it may be impossible for him to get statutory damages; (4) for there to be infringement there also has to be taking of a substantial portion of the copyrighted expression, if it's copyrightable, it may be a weak copyright, it's only protectable to the extent it is original e.g. didn't come from somewhere else; (5) all cases can have an attack on validity, so the defense could show merger (idea and expression are so connected it is not copyrightable) or it is simply an uncopyrightable "short word or phrase" or was procured by fraud (programmer really took it from somewhere else) etc. (6) there is fee shifting in the case of a frivolous case so the programmer might end up paying the other side's attorneys fees. So, as a practical matter, the system has enough barriers to a frivolous case, it's not that much of a problem, is it?

    link to this | view in chronology ]

  • icon
    Killer_Tofu (profile), 8 Dec 2009 @ 6:32am

    As a programmer

    I have to admit that I ended up skipping about half of the comments, but my opinion is that they can take their IP laws and shove em.
    I would rather IP laws stay far away from the computer field. It is a nice and growing field. The more IP laws enter it, anywhere at all, the more the system slows down. Its appalling.

    link to this | view in chronology ]

  • identicon
    DannyB, 8 Dec 2009 @ 9:02am

    SQL query to solve Sodoku

    Someone wrote a SQL query to solve Sodoku. That is obviously, and intuitively recognizable as a creative work. Significant time and thought were probably used to create it. It seems like something that should obviously qualify for copyright protection.

    OTOH, writing:

    SELECT * FROM Students WHERE someDate > ?

    Is not very creative. Probably not creative enough to qualify for copyright. Purely functional in nature. Even devoid of actual creativity.

    Using two extremes it can be argued that a SQL query should definitely be copyrightable, or should definitely not be copyrightable.

    The real question is whether there is anything there to copyright. Any creativity. Since we (apparently) don't know what the actual SQL query looks like, it's hard to argue whether it should be copyrightable.

    As for SQL being different from other computer code, I don't see how? SQL is non-procedural and declarative to be sure. (Although modern SQL implementations allow procedural programming.) Other programming languages are also declarative, such as Prolog or various rules or expert systems. It still can take significant human creativity to write a page of code, even in SQL.

    Without the actual query involved, how can we argue whether it is copyrightable? In my opinion, if the query is similar to what I wrote above, I would take the position that it is devoid of creativity and not copyrightable.

    link to this | view in chronology ]

  • icon
    Jay Fude (profile), 8 Dec 2009 @ 2:10pm

    Silly

    I work in IT at a school, and Have written entire sql databases (well, mysql, we don't want it to break), php code attached to it, and html with svg inside of that, to create clickable maps that link to inventory. None of it has copyright (or left) and I assume that when I move on, someone else will likely edit the heck out of it, and I have no problem with that. Why is it that only holywood and silicon valley think they should get paid for work they did years ago? I get paid to be here, and do my job, I stop doing my job, I stop getting paid, and it is that way for about 90% of the free (as in beer) world.

    link to this | view in chronology ]

  • identicon
    Goodman, 9 Dec 2009 @ 12:07am

    Copyright SQL query!?! You greedy poof!!!

    link to this | view in chronology ]

  • identicon
    Doug Stein, 17 Dec 2009 @ 11:01pm

    Reengineer using clean room techniques...

    IT Guy:

    1) You have the output file from previous years.
    2) You have the DB schema.
    3) Write the darn query from scratch without referencing the "copyrighted" query.
    3a) If you believe you are "contaminated" because you read the original "copyrighted" query, pay a local grad student $250 to write the query with a work-for-hire contract.

    Now you can delete the original query and proceed.

    Doug

    link to this | view in chronology ]

  • identicon
    IntravenusX, 20 Feb 2010 @ 5:11am

    Some Copyright Applies

    Just like music, if you perform a song that has a copyright in a live setting, it is totally legal. It is when you record a video of the performance and try to distribute it, then you are in violation. I am sure the copyright is there to be a unique entity for the published website, not to be copied into forums and other replicating sites. This type of information can be used to drive traffic to their site and therefore should be respected from an ethical standpoint. In short, use the query if needed, just don't repost it anywhere. Thanks.

    link to this | view in chronology ]


Follow Techdirt
Essential Reading
Techdirt Deals
Report this ad  |  Hide Techdirt ads
Techdirt Insider Discord

The latest chatter on the Techdirt Insider Discord channel...

Loading...
Recent Stories

This site, like most other sites on the web, uses cookies. For more information, see our privacy policy. Got it
Close

Email This

This feature is only available to registered users. Register or sign in to use it.