Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from doctor ;
- +----+-----------------+
- | id | name |
- +----+-----------------+
- | 1 | Fred Flintstone | They retrained :-)
- | 2 | Barney Rubble |
- +----+-----------------+
- select * from specialization ;
- +----+------------+
- | id | name |
- +----+------------+
- | 33 | Neurology |
- | 44 | Psychiatry |
- | 55 | Radiology |
- +----+------------+
- select * from doctor_specialization ;
- +--------+---------+
- | doc_id | spec_id |
- +--------+---------+
- | 1 | 33 |
- | 2 | 55 |
- +--------+---------+
- primary key ( doc_id, spec_id )
- foreign key ( doc_id ) references doctor ( id )
- foreign key ( spec_id ) references specialization (id )
- create index i_ds_spec
- on doctor_specialization ( spec_id, doc_id ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement