Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 3
    I wouldn't want to actually store one relation inside another - they'd be in separate tables and denormalized as usual. I'm just asking why this sort of embedding of results isn't allowed in queries, when it seems more intuitive to me than the join model. Commented Jul 7, 2011 at 16:15
  • Result sets and tables are of a kind. Date calls them relations and relvars respectively (by analogy, 42 is an integer, whereas a variable x can have the value of integer 42). The same operations apply to relations and relvars, so their structure needs to be compatible. Commented Jul 7, 2011 at 19:17
  • 2
    Standard SQL does support nested tables. They are called "structured types". Oracle is one DBMS that has this feature. Commented Jul 8, 2011 at 10:45
  • 2
    Isn't it slighty absurd to argue that to avoid data duplication, you must write your query in a flat, data-duplicating manner? Commented May 19, 2013 at 7:59
  • 1
    @EamonNerbonne, symmetry of relational operations. For example, projection. If I SELECT some sub-attributes out of an RVA, how can I apply a reverse operation against the result set to reproduce the original hierarchy? I found page page 293 of Date's book is on Google Books, so you can see what he wrote: books.google.com/… Commented Nov 28, 2013 at 16:43