Solved

relation between two tables/views

Posted on 2012-04-12
10
484 Views
Last Modified: 2012-04-20
hi guys


In my ER diagram i see

table1  arrow  table2

what does the arrow mean ?

thanks
0
Comment
Question by:royjayd
  • 3
  • 2
  • 2
  • +2
10 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 137 total points
ID: 37837578
assuming the arrow is from table1 to table2

table1 has a many to one relationship with table2

so table2 is likely the parent of table1
0
 

Assisted Solution

by:gnivkor
gnivkor earned 25 total points
ID: 37837626
that there is a relationship to that table through some sort of constraint, maybe primary / foreign or unique
0
 
LVL 16

Assisted Solution

by:Milleniumaire
Milleniumaire earned 63 total points
ID: 37838045
The fact that the line is dotted means the relationship is optional.  The small vertical line through the dotted line implies that the key of table1 (table on the left) is part of the key of table2 (on the right).

I've never seen an ER diagram that uses arrows on the end of the lines and I can only guess that this is suggesting the direction of the relationship, as described by sdstuber.
0
 
LVL 23

Expert Comment

by:David
ID: 37838123
Partial correction to gnivkor above, the relationship is one or more columns in column, commonly called a parent to child relationship.  IOW for any given parent table row, there MAY be one or more child table rows.  Constraints are required to enforce relational integrity -- but they are not required.  

royjayd, here's a reference to explain the different relationships shown by crow's-foot notation:  w2.cs.uregina.ca/~bernatja/crowsfoot.html

HTH,
dvz
0
 

Author Comment

by:royjayd
ID: 37838284
My inititial understanding in laymans terms: The table which has primary key (one)  --> maps to table in which that primary key is used as a foreign key (many).
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 23

Assisted Solution

by:David
David earned 125 total points
ID: 37838316
Nods, the parent shares a family name with her/his child(ren).  In this example, there would be a primary (unique) key constraint on the parent, and that value is also stored in each child.  For RI you define a foreign key in the child table, referencing the parent key value.
0
 
LVL 16

Expert Comment

by:Milleniumaire
ID: 37838323
Yes, that is correct in terms of primary and foreign key references.  In terms of the ERD, the many side of the relationship is shown with a "crows foot" and the one side with a single line.
0
 

Author Comment

by:royjayd
ID: 37856989
is Many to One relationship just flipping One to Many relationship ? or is there anything extra to it? For example the above arrow can be used to represent Many-to-One and
One-to-Many relationship aswell, right?

thanks
0
 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 137 total points
ID: 37857004
yes

I used the phrase "many to one" based on the direction of the arrow.

but had it been pointing the other way I'd have said "one to many"
0
 
LVL 23

Assisted Solution

by:David
David earned 125 total points
ID: 37857294
Different notations are used for other business rules beyond 1-M, roy.  In your example the bisecting line shows one-or-more.  Replace the "1" line with "0" and (no surprise) it represents zero or more.  The order in which the entities/tables are described may be flipped (sbstuber above, 37867004).

See if this example helps:  a business must have one and only one tax ID number, and a tax ID number is unique to one business.  However, a business must have at least one address; that business MAY have multiple addresses; and an address MAY be used by one or more businesses.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Cross Outer Join 4 52
Format Number Field 10 40
Oracle Finace 3 48
history tablespace temp usage 2 17
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to recover a database from a user managed backup
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now