d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Sql Oracle Question
Prev12
Add Reply New Topic New Poll
Member
Posts: 4,572
Joined: Jun 28 2006
Gold: 1,376.49
Nov 24 2015 04:14am
So if I get it right, you need 3rd table for event id and event name and then a 4th table for connections because 1 ship can have multiple events connected to it and each ship/event pair has 0 or 1 port connected to it.

And then you just left join the connection table to the other 3 tables to get all the information back.

There is probably a docking event (don't see it on that image though), so you need to join all the 3 tables, list only the lines with that specific event and order by dock name and then ship name.

This post was edited by Cyberbeni on Nov 24 2015 04:18am
Member
Posts: 6,175
Joined: Sep 4 2009
Gold: Locked
Trader: Scammer
Nov 24 2015 12:43pm
I think i was overcomplicating things. I created a table with the 2 primary key as one ( composite key).

Inserted the values from the table (portid, ship number)

The third table I've created will allow me to use the select join method between the 2 tables

Quote
your ShipPort table holds the common fields you join on. i gave a sample query a few posts above


This post was edited by Chesse on Nov 24 2015 12:49pm
Member
Posts: 5
Joined: Nov 28 2015
Gold: 90.00
Nov 28 2015 01:06pm
Hello Cheese

I can give an example of Many to Many relationships

Many to Many

How many Students can teachers have? Many
how many teachers can students have? Many


Join Method:

When looking at what your provided for us to use as the example. We need to table because we do not want to keep typing the same name out over and over. This allows use to create a drop down menu when inserting a new row.
Member
Posts: 6,175
Joined: Sep 4 2009
Gold: Locked
Trader: Scammer
Nov 29 2015 08:22pm
Quote (GorillaMan @ Nov 28 2015 11:06am)
Hello Cheese

I can give an example of Many to Many relationships

Many to Many

How many Students can teachers have? Many
how many teachers can students have? Many


Join Method:

When looking at what your provided for us to use as the example. We need to table because we do not want to keep typing the same name out over and over. This allows use to create a drop down menu when inserting a new row.


thanks for clarifying, I understand the concept now.

Is anyone here good with E-R diagrams and could possibly look over my model?
I can give out my remaining fg if anyone is interested
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Nov 29 2015 08:30pm
Post it.
Member
Posts: 6,175
Joined: Sep 4 2009
Gold: Locked
Trader: Scammer
Nov 29 2015 08:38pm
Quote (carteblanche @ Nov 29 2015 06:30pm)
Post it.


I am still working on the multiplicities, relationships, and attributes. I would also rather pm the person who is interested to avoid any possible conflicts :o
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll