Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. select * from doctor ;
  2.  
  3. +----+-----------------+
  4. | id | name |
  5. +----+-----------------+
  6. | 1 | Fred Flintstone | They retrained :-)
  7. | 2 | Barney Rubble |
  8. +----+-----------------+
  9.  
  10. select * from specialization ;
  11.  
  12. +----+------------+
  13. | id | name |
  14. +----+------------+
  15. | 33 | Neurology |
  16. | 44 | Psychiatry |
  17. | 55 | Radiology |
  18. +----+------------+
  19.  
  20. select * from doctor_specialization ;
  21.  
  22. +--------+---------+
  23. | doc_id | spec_id |
  24. +--------+---------+
  25. | 1 | 33 |
  26. | 2 | 55 |
  27. +--------+---------+
  28.  
  29. primary key ( doc_id, spec_id )
  30. foreign key ( doc_id ) references doctor ( id )
  31. foreign key ( spec_id ) references specialization (id )
  32.  
  33. create index i_ds_spec
  34. on doctor_specialization ( spec_id, doc_id ) ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement