0

I have 2 tables in non-first normal form:

enter image description here

What would be the result of the NATURAL JOIN operation of these two table?

nvogel
  • 24,981
  • 1
  • 44
  • 82
noobcoder
  • 150
  • 2
  • 16
  • 1
    Please read & act on [ask], hits googling 'stackexchange homework' & the downvote arrow mouseover text. Quote the definition(s) you are using. Show/justify your work/reasonin following them. The first place you are stuck explain about why. PS Please [use text, not images/links, for text (including code, tables & ERDs)](https://meta.stackoverflow.com/q/285551/3404097). Use a link/image only for convenience to supplement text and/or for what cannot be given in text. And never give a diagram without a legend/key. Make your post self-contained. – philipxy Nov 23 '18 at 19:44
  • 1
    What relations are those grids pictures of? You don't have an attribute name topping your columns & you don't have a single value for an attribute in a row. Suggest you rewrite them so you do. We can guess that the third column in each has attribute name X--is that right? We can guess that the value for an X attribute is the obvious relation made from the array of values & attributes C & D--is that right? (You are confusing something about attribute names & types.) Quote your textbook's definitions of "relation" & "natural join" (etc), give the relation values clearly & show work using them. – philipxy Nov 23 '18 at 19:53
  • 1
    PS If you made proper headings that were sets/lists of attribute names and just replaced the attribute values by x*N*, what would your answer be? PS If you were *given* those grids, how were you told to interpret them as relations? PS What does this have to do with your tag [tag:object-relational-model]? PS ["1NF" has no single meaning.](https://stackoverflow.com/a/40640962/3404097) – philipxy Nov 23 '18 at 20:00

1 Answers1

1

It is not exactly clear what your picture is supposed to represent. I'm going to assume that R1 is a relation with three attributes, A,B and X; R2 is a relation with three attributes, E,B and X.

The natural join would be a join where the values in B and X are equal in both R1 and R2. What type of attribute is X? If X is a relation-valued attribute and the columns labelled C and D represent the tuples in X then it seems that the relation values are different in each case. (X in R1 and X in R2 happen to have some of the same tuple values in common but the values of relation X are different in each case).

So the result of the natural join would be an empty relation with a heading of A,B,E,X but with zero tuples.

nvogel
  • 24,981
  • 1
  • 44
  • 82
  • Your picture is apt to confuse because it includes some sort of type info in column 3 of the heading when it doesn't for the others. If you're using some convention with a special layout for relation-valued attributes, you should say so. Even if that's *maybe* what the asker is consciously doing (in headings & values). – philipxy Nov 23 '18 at 20:47