I've learned. I'll share.

August 26, 2009

SQL is now turing complete!

David Fetter at Oscon 2009 just made a stunning claim: With CTE and Windowing, SQL is Turing Complete. He even offers a proof and an amazing example (although I'm not sure if the example requires turing completeness, it's still amazing).

This could be a big deal. Why? It means that you can do anything in an SQL query. While drawing the mandlebrot set is a nice demo, the first "killer app" will be tree traversal. Lots of relational tables end up looking like trees and are a royal pain to deal with in normal SQL. After that, only our imagination (and performance) is the limit. You can theoretically create any data view that runs in the DB all in one shot, without any of the troubles of stored procedures.

I see a similarity between turing-complete SQL in the DB and JavaScript on the browser. For years, we used JavaScript to do silly stuff, but then a few bright minds created amazing tools like gmail and google maps and our view of JavaScript was forever changed. Now JavaScript is everywhere and there's a race to make the best development framework and engines fastest engines.

Might the same thing happen with turning-complete SQL? is the race on to be the first programming language to compile down to turing-complete SQL?.

Honestly, if I were a betting man, I'd say it won't come to anything significant. But I'll also guess that the lure of compiling down to SQL will eventually capture someone, somewhere. It's only a matter of time. In fact, if you're a programming language geek, the sirens are probably calling to you right now :). When it does happen, I expect the first language to be a functional one, especially one with a small core, like a variant of lisp. Once we get clojure in clojure, maybe it will be a candidate. Or maybe C# will end up with LINQ-to-turning-complete-SQL (SQLINQ?).

What do you think?

61 comments:

  1. Is the resultant SQL still truly declarative? It will take someone cleverer than me to answer that question - but if it is - then this is a very interesting thing indeed.

    ReplyDelete
  2. From what I read on the netz the following two statements are equal: "This programming language is declarative","There is a DEFINED one-to-one correspondence between written code and produced machine instructions", so in that case since the compiler is not yet written i doubt it's standardized, and hence the language is declarative.

    ReplyDelete
  3. what do I think? reminds me of what Prolog had already accomplished. Then came SQL that didn't nest non-deterministically deep. Then came SPARQL that I guess tried to again take a page from Prolog to add that aspect back in. What's wrong with Prolog? Why do we have to call it other things?

    ReplyDelete
  4. SQL is very useful for those students who are learning drawing on windows and want to become web designer.I am a writer of phd dissertation writing services and I write all types of Assignments.

    ReplyDelete
  5. Excellent Post. In fact, I'm making it a sticky so other can find it later. Thanks!
    animal crossing

    ReplyDelete
  6. this is really nice to read..informative post is very good to read..thanks a lot!


    seo services in lahore

    ReplyDelete
  7. I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors? Will be back again frequently to check up on new posts.


    seo company in lahore

    ReplyDelete
  8. thanks for the tips and information..i really appreciate it..

    digital marketing agency in lahore

    ReplyDelete
  9. It was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks.

    Web App Development Services UAE

    ReplyDelete
  10. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work.
    Software Development Company UAE

    ReplyDelete
  11. Nice to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.

    Custom Website Development in UAE

    ReplyDelete
  12. Paper Lords is here to provide Best Essay Writing Service, our best essay writing service in UK is written by highly qualified essay writers, feel free to contact us and take our services.

    ReplyDelete
  13. Paper Lords provide best Best Course Writing Service. our coursework writing service in UK produce a paper that will provide you a coursework help in your academic career

    ReplyDelete
  14. Need dissertation writing service in UK, Paper Lords are providing best dissertation writing service with premium quality dissertation writers to help in your dissertation

    ReplyDelete
  15. Acquire custom dissertation help from Paper Lords! Our Top dissertation writing services are trusted by the students in the UK due to its best quality.

    ReplyDelete
  16. Pro Dissertation Writing provide Top dissertation writing services in UK. Pro Dissertation Writing is here to provide quality-based dissertation writing services to help students getting over the pressure situation.

    ReplyDelete
  17. Pro Dissertation Writing provide Top dissertation writing help in UK. Pro Dissertation Writing is here to provide quality-based dissertation writing services to help students getting over the pressure situation.

    ReplyDelete

  18. Our academic dissertation writing services aim to help all students cater to all the educational requirements. Our academic dissertation writing services by natives are capable of preparing quality paper for all the tasks

    ReplyDelete
  19. Pro Dissertation Writing provide best custom dissertation help, being fully aware of the fact that for students it is the toughest task ahead. Our team of best dissertation writing services in the UK is here to assist you throughout the process.

    ReplyDelete
  20. We have the quality centric, and tailored sociology dissertation services, our sociology dissertation editors will ensure your dissertation and give their best.

    ReplyDelete
  21. Top Expert Dissertation Writer. Our dissertation writing service will help you write your PhD dissertation or Master's thesis within the shortest time frame.

    ReplyDelete
  22. As far as Bachelor Dissertation Writing Services is concerned, Pro Dissertation Writing provide finest Bachelor Dissertation Writing Services We know the students problems and thus we resolve their issues related to bachelor dissertation.

    ReplyDelete
  23. Looking for art dissertation help by industry experts. Pro dissertation Art dissertation help UK is most popular and offer the most reliable and quality services.

    ReplyDelete
  24. When student buy dissertation writing services with Pro Dissertation, get reliable and best dissertation writing services at an affordable cost.

    ReplyDelete
  25. Our philosophy dissertation writing services handle the dissertation on any topic. We are the leading philosophy dissertation service providers. Our expert team is dedicated to helping you achieve your dream.

    ReplyDelete
  26. Thanks for sharing this.,
    Leanpitch provides online training in Scrum Master during this lockdown period everyone can use it wisely.
    Join Leanpitch 2 Days CSM Certification Workshop in different cities.

    Scrum master certification

    csm certification

    certified scrum master certification

    certified scrum master

    agile scrum master certification

    scrum master certification cost

    csm certification cost

    Scrum master Training

    Scrum master

    Best Scrum master certification

    ReplyDelete

  27. I do not even know how I ended up here, but I thought this post was great.
    I don't know who you are but certainly you are going to a famous blogger if you aren't already ;) Cheers!

    Please Visit My homepage ➤ 오피

    (freaky)

    ReplyDelete
  28. There are a lot of blogs over the Internet. But I can surely say that your blog is amazing in all. It has all the qualities that a perfect blog should have.
    Best SEO Company in Lahore

    ReplyDelete
  29. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.
    Digital Marketing Services in Pakistan

    ReplyDelete
  30. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
    Best Web Development Company in Lahore

    ReplyDelete
  31. Finest blog! I would like to thank for the efforts you have made in writing this post. Hopefully that you will write many more posts like this one. If you're an AOL advanced plan user and you want to Install AOL Desktop Gold software, this blog provides you a quick and easy process by which you can install it in a very short time.

    ReplyDelete
  32. This comment has been removed by the author.

    ReplyDelete
  33. Pretty portion of content. I simply stumbled upon your weblog and in accession capital
    to say that I acquire in fact loved account your weblog posts.
    Anyway I will be subscribing to your feeds
    or even I success you access consistently fast.
    고스톱

    ReplyDelete
  34. Hi to all, it’s in fact a nice for me to pay a visit this web page, it consists of useful Information
    I constantly spent my half an hour to read this web site’s content daily along with a cup of coffee.
    thank you for this informative post.
    토토사이트

    ReplyDelete
  35. Digisol hub is a one stop digital marketing solution for all your online and offline marketing needs. We provide our clients with the best digital marketing strategies!
    to help them grow their business.

    ReplyDelete
  36. Personally, if all web owners and bloggers made good content as you did, the net will be much more useful than ever before. You might also like walmart carpet cleaner rental near switzerland 

    ReplyDelete
  37. I am happy to be here and this wonderful blog. I have found here lots of important information for my knowledge I need. Thanks for sharing this amazing post. If you want to Recover Spectrum Email Server Not Working please contact roadrunner support team for solution.

    ReplyDelete
  38. هل تبحث عن اكبر افضل شركة اثاث مكتبي في مصر هناك الكثير من الشركات انصحك بشركة ستار وود.

    ReplyDelete
  39. Best information team. Get avail your best service regarding essay maker where you will get best content done on time with help of experts who provide you best content on time with as reasonable price.

    ReplyDelete
  40. This makes it important to highlight certain areas that students need to review to identify the best service providers

    ReplyDelete
  41. Great post. I appreciate for your efforts. If you are looking for writing service in UK ,We offer thorough, statistics assignment help
    service.

    ReplyDelete
  42. Keep up the great job on your website, please. I like your post and especially appreciate your ideas on SQL. They're all incredible, and I value your sharing your knowledge with us. I sincerely appreciate it. In any case, I advise hiring english literature dissertation examples aid service writers to do your work if you need dissertation assistance. I truly hope you find this website helpful and are happy with the outcomes after using this service.

    ReplyDelete
  43. Thankyou for sharing such informative SQL blog.

    ReplyDelete
  44. Excellent post. SQL is very useful for those students who are learning drawing on windows and want to become web designer. Now it's time to avail Siding Services In Alachua County FL for more information.

    ReplyDelete
  45. Awesome post. Thanks to sharing your information, I appreciate for your efforts and your work. If you are Looking for a toy shop online Dubai for your Kids, Dubai Toys Wholesale Store is best option .

    ReplyDelete
  46. Nice post. Really I appreciate for your work. Babes N Buddies provide Dog Food In Noida. With a signature blend of wholesome meat, fresh vegetables, and nutritious grains, this premium dog food will keep your pup feeling energized and happy all day long.

    ReplyDelete
  47. I just wanted to take a moment to thank you for your wonderful blog. Your content is always of high quality, and I find it both informative and interesting. Your dedication to providing great information is truly appreciated, and I look forward to reading more of your posts. Keep up the fantastic work
    separation agreement in virginia

    ReplyDelete
  48. Dragon Fruit Plant requires specific growing conditions. It prefers well-drained soil with a slightly acidic pH level. The plant can tolerate drought, but it requires regular watering, especially during the flowering and fruiting stages. It thrives in full sunlight but can also grow in partially shaded areas. The Dragon Fruit plant is a climbing cactus and requires support, such as trellises or stakes, to help it grow upright.

    ReplyDelete
  49. Stantander Login: A Safe and Convenient Approach. Embrace Novuna Personal Finance for Sound Money Management. @ stantander login

    ReplyDelete
  50. Hello, I read your blog which is very good. Thanks for sharing this information.
    Looking for SPSS Assignment Help? Our expert team provides comprehensive assistance with SPSS assignments, ensuring accurate analysis and interpretation of data. Get top-notch guidance and achieve academic success with our reliable SPSS assignment help services.

    ReplyDelete
  51. Looking for a New Jersey Divorce Lawyer, Our expert team is here to help your challenging time.

    ReplyDelete

Blog Archive

Google Analytics