Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help for create table relationship between tables (MySQL)

Posted on 2008-10-05
2
Medium Priority
?
945 Views
Last Modified: 2012-05-05
I'm new for the Php and MySQL and still studying.I have to complete e-channeling project for my study purpose and created following tables.I need

01)I need users to allow select multiple doctors.When he login show only he selected doctors.

02)one doctor can be specialist for one or more specialization.So i need relationship between them.

03)Availability(for example when user select Monday need show all Mondays in month and availability.

I think i have to create another tables and need create relationship between table.Please help me for create diagram for my project! i have create the diagram and attached it.

01)Users (user_id,username,password,salution,first_name,last_name,address, tel ,email)

02) Doctors(doc_id,salutation,initials,first_name,surname,address,tel,email)

03)Specialization(spe_id,specialization)

04)Hospital(hos_id,hos_name)

05)Weekdays(week_id,days)

06)Admin Users(admin_id,admin_name,admin_password)

Thanks
tables.jpg
0
Comment
Question by:chaminda7245
1 Comment
 
LVL 4

Accepted Solution

by:
kingmonty earned 2000 total points
ID: 22647456
You will need a users/doctors relationship - many to many

table doctors_to_users:
user_id, doc_id (unique index user_id,doc_id as doc_to_usr_idx)

same for specialization/doctors

table spec_to_doc
doc_id,spe_id (unique index doc_id,spe_id as spec_to_doc_idx)

etc.



0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month6 days, 4 hours left to enroll

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question