Jump to content

Recommended Posts

I'm new for the MySQL and Php.I have to complete project for my class.Please help me to create table structure for doctors e channeling system.

 

I have created some tables structure and I need to know how create relationship between tables.

 

 

01)Need create relation ship between users and doctors.User can select one or many doctors from list box and when he login to website need show only selected doctors details(name.specializations,Hospital)

 

02)Doctors can be specialist for one or many specialization.

 

03)Search option should be by doctors by specializations by day(Monday to Sunday)If Monday select  need show whole Mondays in month and availability.

 

I think i have to create many more tables for relationship.Please help me for create table structure.

 

Thanks & Regards,

 

Chaminda7245

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/127333-mysql-table-relationship/
Share on other sites

You have your main entities

 

Users, Doctors, Specialization, Hospital, Weekday

 

Look at each pair in turn and ask yourself "What is the relationship"

 

1 ) One to Many

 

eg A hospital has many doctors but a doctor works for one hospital.

 

In this case the id of the ONE table (hospital) is added to the columns for the MANY table (doctor)

 

2 ) Many to Many

 

eg a user can have many doctors and a doctor can have many users

 

In this case you need an intermediate linking table containing the ids of doctor and user.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.