473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Wanted information about handling database.

I have two database Student and Course both have a
relation on it. Student ID is the primary key for Student
Table and Course ID is the primary key for course table.
As per my logic, one student can enroll for different
courses. Say X person can enrol for Y1, y2, y3 courses. I
want to store data in the database in the format X/Y1 if
the MR X person enrols for Y1 course and according X/Y2 if
he enrolls for Y2 course and so on.

Please help me on what can be done to implement this
logic. I have a hint for this is the use of Substring
function.

Jul 21 '05 #1
1 1193
You can use a linking table, with StudentID, CourseID and you can make this
a key of the linking table.

So Student has Students 1, 2, 3, 4, 5, and Courses has Y1, Y2, Y3, Y4

Linking table
1, Y1
1, Y2
1, Y3
1, Y4
2, Y1
3, Y2
4, Y1
4, Y2

etc...

and if relate them back to each respective parent, you won't have the
possibility of any junk records/orphans.

HTH,

Bill
"Shyam Singh" <sh****@flashindia.com> wrote in message
news:09****************************@phx.gbl...
I have two database Student and Course both have a
relation on it. Student ID is the primary key for Student
Table and Course ID is the primary key for course table.
As per my logic, one student can enroll for different
courses. Say X person can enrol for Y1, y2, y3 courses. I
want to store data in the database in the format X/Y1 if
the MR X person enrols for Y1 course and according X/Y2 if
he enrolls for Y2 course and so on.

Please help me on what can be done to implement this
logic. I have a hint for this is the use of Substring
function.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: simonc | last post by:
I've been programming in assembler and C/C++ for a number of years, but I'm only just starting down the road of PHP & MYSQL. I have a couple of questions: (1) Before I start writing my own...
6
by: Simon Wigzell | last post by:
My client wants to have credit card information fields on his forms for his website visitors to be able to buy his wervices by credit card. The credit card info - Brand, number and expiry date will...
2
by: Oswaldo Gómez RCN | last post by:
Hy all, We have two databases with similar information (both, made with MS Acess). Both, A and B, have - in some cases - the same information, names etc. Database A has the following fields. ...
0
by: cronman | last post by:
I am creating a small Windows application using Visual C# 2005 Express Edition (August CTP) for a small non-profit agency. My current issue is with updating related information in an Access...
1
by: Shyam Singh | last post by:
I have two database Student and Course both have a relation on it. Student ID is the primary key for Student Table and Course ID is the primary key for course table. As per my logic, one student...
10
by: madereal | last post by:
Situation: I have a database that has users with different levels of access to the information they are allowed to view. I have addressed this issue by creating a login form that opens on startup....
1
by: Rusty Hill | last post by:
I am creating a web app to be shared amongst companies. Each user's credentials will be in the common ASP.NET membership database. Each company will have their own data base. I need to be able...
5
by: Charles May | last post by:
Anyone have a simple concept for the best way to store timeclock information in a database. I currently have my table set up like this with a typical daily entry. tcID empID Type ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.