{"id":8186,"date":"2013-11-06T13:41:45","date_gmt":"2013-11-06T18:41:45","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=8186"},"modified":"2013-11-06T13:47:07","modified_gmt":"2013-11-06T18:47:07","slug":"do-subqueries-add-expressive-power-to-sql-queries","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/11\/06\/do-subqueries-add-expressive-power-to-sql-queries\/","title":{"rendered":"Do Subqueries Add Expressive Power to SQL Queries?"},"content":{"rendered":"<p><a href=\"http:\/\/cs.stackexchange.com\/questions\/129\/do-subqueries-add-expressive-power-to-sql-queries\">Patrick87<\/a> (via <a href=\"https:\/\/twitter.com\/CompSciFact\/status\/397404463595810816\">@CompSciFact<\/a>):<\/p>\n<blockquote cite=\"http:\/\/cs.stackexchange.com\/questions\/129\/do-subqueries-add-expressive-power-to-sql-queries\"><p>Are there any known forms to which all SQL queries can be reduced? Do any of these eliminate subqueries? Or are there some instances where no equivalent, subquery-free query exists?<\/p><\/blockquote>\n<p>The answer is yes for SQL, but for <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Reference\/Foundation\/Classes\/NSPredicate_Class\/Reference\/NSPredicate.html\">NSPredicate<\/a> <a href=\"http:\/\/funwithobjc.tumblr.com\/post\/2726166818\/what-the-heck-is-subquery\">subqueries<\/a> do <a href=\"http:\/\/stackoverflow.com\/questions\/3810992\/quick-explanation-of-subquery-in-nspredicate-expression\">add expressiveness<\/a> because the base queries are more limited.<\/p>","protected":false},"excerpt":{"rendered":"<p>Patrick87 (via @CompSciFact): Are there any known forms to which all SQL queries can be reduced? Do any of these eliminate subqueries? Or are there some instances where no equivalent, subquery-free query exists? The answer is yes for SQL, but for NSPredicate subqueries do add expressiveness because the base queries are more limited.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[69,71,677],"class_list":["post-8186","post","type-post","status-publish","format-standard","hentry","category-technology","tag-cocoa","tag-programming","tag-sql"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=8186"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8186\/revisions"}],"predecessor-version":[{"id":8190,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/8186\/revisions\/8190"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=8186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=8186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=8186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}