Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As I understand it, you want salarie and consultant to be able to have many experiences but one particular experience should not belong to several different consultants/salaries. Therefore, I think you designed it correctly but perhaps you should set foreign key constraints on salarie_id and consultant_id in the experience table. </p> <p>However, it might be so that you rather have employees which in turn have roles. For example:</p> <p><a href="http://img16.imageshack.us/img16/9437/picture4ik.png" rel="nofollow noreferrer">alt text http://img16.imageshack.us/img16/9437/picture4ik.png</a></p> <pre><code>-- ----------------------------------------------------- -- Table employe -- ----------------------------------------------------- DROP TABLE IF EXISTS employe ; CREATE TABLE IF NOT EXISTS employe ( idemploye INT NOT NULL AUTO_INCREMENT , nom VARCHAR(255) NOT NULL , PRIMARY KEY (idemploye) ) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table experience -- ----------------------------------------------------- DROP TABLE IF EXISTS experience ; CREATE TABLE IF NOT EXISTS experience ( experience_id INT(11) NOT NULL AUTO_INCREMENT , employe_idemploye INT NOT NULL , post VARCHAR(255) , entreprise_name VARCHAR(255) , start_time VARCHAR(255) , end_time VARCHAR(255) , description VARCHAR(10000) , PRIMARY KEY (experience_id, employe_idemploye) , INDEX fk_experience_employe (employe_idemploye ASC) , CONSTRAINT fk_experience_employe FOREIGN KEY (employe_idemploye ) REFERENCES employe (idemploye )); -- ----------------------------------------------------- -- Table role -- ----------------------------------------------------- DROP TABLE IF EXISTS role ; CREATE TABLE IF NOT EXISTS role ( idrole INT NOT NULL AUTO_INCREMENT , employe_idemploye INT NOT NULL , nom VARCHAR(45) NOT NULL , PRIMARY KEY (idrole, employe_idemploye) , INDEX fk_role_employe (employe_idemploye ASC) , CONSTRAINT fk_role_employe FOREIGN KEY (employe_idemploye ) REFERENCES employe (idemploye )) ENGINE = InnoDB; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload