I am new to SQL and relational DBMS. I want to retrieve records from a relational database if they satisfy 3 given properties.
For example, if there is a table containing info about solids:
table_solid : |s_id|s_name|description| table_width : |w_id|w_name| table_height: |h_id|h_name| table_length: |l_id|l_name|
where *_id are all primary keys.
I have 3 more tables for relating these tables with Foreign Keys.
table_s_h: |s_id|h_id| table_s_w: |s_id|w_id| table_s_l: |s_id|l_id|
Would you please explain how do I join these.
Thanks in advance.
--------- table_length table_SOLID ---- ----------- table_width ------------table_height
table_length contains valid lengths that solid can take (and similarly with other tables).
From a single table:
Is that what you are looking for? Or are you trying to query multiple tables? If so try this:
This link may be of use to you http://dev.mysql.com/doc/refman/5.0/en/join.html