I think that the biggest problem with SQL is more around the actual syntax of the language and how verbose it feels to write complicated ...
I think that the biggest problem with SQL is more around the actual syntax of the language and how verbose it feels to write complicated queries. I would prefer a syntax layer that can be compiled / transformed back to SQL but that does basic things like having a query start with the tables, then joins, then groupings then the final projection. Also a less cumbersome way to use the "WITH" statement to form named sub-queries. Perhaps something like: SELECT COUNT(*) as columns, column_type, table_name FROM ( SELECT c.id, c.type AS column_type, t.name AS table_name FROM tables t INNER JOIN columns c ON t.id = c.table_id WHERE t.system=false; ) a HAVING COUNT(*) > 1 ORDER BY columns DESC Being re-written as: # Use ":=" to replace WITH for named ephermal views # Replace "WHERE" with "?", "SELECT" with "|>" at the end non_system := tables ? system=false |> name:table_name, is:table_id # Replace INNER JOIN with "*=" non_system_columns := non_system.table_id *= columns.table_id |> c.id, c.type:column_type # GROUP BY columns are automatically generated by non-aggregated columns column_types := non_system_columns |> COUNT(*):columns DESC, column_type, table_name So the final query may look like: non_system := tables ? system=false |> name:table_name, is:table_id non_system_columns := non_system.table_id *= columns.table_id |> c.id, c.type:column_type non_system_columns |> COUNT(*):columns DESC, column_type, table_name Any thoughts on this?
Posted by siganakis on Sep 2, 2014, 1:05 AM
Tags
Related issues
- > Because they don't believe the disasters were inflicted by them.
- Hehe, yeah I'm not sure when John Stewart would have worked there or what the pain points were for him, but he worked there for a bit.
- https://www.apple.com/shop/product/mxcl3ll/a/magic-keyboard-...
- If first-order hybrids made up only a small proportion of the total population of humans and Neanderthals, then the probability that a pa...
- Well, I'd be interested to hear what some of those nuances are, personally.
- My biggest Amazon annoyance.
Raise real-world problems, find people facing the same issue, and discuss solutions.9,000 issues0 comments
hackernews (E-commerce)
> Because they don't believe the disasters were inflicted by them.
Hehe, yeah I'm not sure when John Stewart would have worked there or what the pain points were for him, but he worked there for a bit.
https://www.apple.com/shop/product/mxcl3ll/a/magic-keyboard-...
If first-order hybrids made up only a small proportion of the total population of humans and Neanderthals, then the probability that a pa...
Well, I'd be interested to hear what some of those nuances are, personally.
My biggest Amazon annoyance.
> There's not really an unmet need for innovation in broadband delivery; the issue is running new wires broadband has costs, and in a lot...
Speaking of Amazon's account process, I have a really annoying problem with theirs.
I think that the biggest problem with SQL is more around the actual syntax of the language and how verbose it feels to write complicated ...
I think that the biggest problem with SQL is more around the actual syntax of the language and how verbose it feels to write complicated queries. I would prefer a syntax layer that can be compiled / transformed back to SQL but that does basic things like having a query start with the tables, then joins, then groupings then the final projection. Also a less cumbersome way to use the "WITH" statement to form named sub-queries. Perhaps something like: SELECT COUNT(*) as columns, column_type, table_name FROM ( SELECT c.id, c.type AS column_type, t.name AS table_name FROM tables t INNER JOIN columns c ON t.id = c.table_id WHERE t.system=false; ) a HAVING COUNT(*) > 1 ORDER BY columns DESC Being re-written as: # Use ":=" to replace WITH for named ephermal views # Replace "WHERE" with "?", "SELECT" with "|>" at the end non_system := tables ? system=false |> name:table_name, is:table_id # Replace INNER JOIN with "*=" non_system_columns := non_system.table_id *= columns.table_id |> c.id, c.type:column_type # GROUP BY columns are automatically generated by non-aggregated columns column_types := non_system_columns |> COUNT(*):columns DESC, column_type, table_name So the final query may look like: non_system := tables ? system=false |> name:table_name, is:table_id non_system_columns := non_system.table_id *= columns.table_id |> c.id, c.type:column_type non_system_columns |> COUNT(*):columns DESC, column_type, table_name Any thoughts on this?
Comments (0)
No comments yet. Start the discussion.