<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 1, 2015, at 12:29 PM, Michael Kay <<a href="mailto:mike@saxonica.com" class="">mike@saxonica.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><br class="">And BTW Michael, if SQL  would be good for querying hierarchical data, why in the world did we waste 16 years building XQuery !???<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">It didn’t say it was good for the purpose. I said it was possible. The only reason I can think of for actually doing it is that there’s a fair bit of software out there that likes to access its data using SQL.</span></div></blockquote><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></blockquote></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">The paper I wrote with Donald Kossmann in 1997 about mapping XML into relations ALSO included the </div><div class="">SQL queries equivalent to the simplest XPath expressions.</div><div class=""><br class=""></div><div class="">Those SQL queries are HORRENDOUSLY complicated.</div><div class=""><br class=""></div><div class="">I don’t care how many tools use SQL. </div><div class=""><br class=""></div><div class="">Two things come to my mind:</div><div class=""><br class=""></div><div class="">1. Nobody will write such SQL queries (that result from the mapping JSON-> tables or XML -> tables) and</div><div class=""><br class=""></div><div class="">2. Even if you manage to write them somehow, the queries are SO complex, the relational database engines are not capable </div><div class="">of dealing with them — not even Oracle.</div><div class="">(Jay here <a href="https://www.linkedin.com/profile/view?id=955015" class="">https://www.linkedin.com/profile/view?id=955015</a> wrote his PhD about such SQL queries, and I think he wakes</div><div class="">up with nightmares even now…)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Tools will need to adapt to a new query language for JSON. Or we need new tools. Or we abandon JSON.</div><div class=""><br class=""></div><div class="">That’s as simple as that.</div><div class=""><br class=""></div><div class="">Best regards</div><div class="">Dana</div></body></html>