473,499 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1195
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
3100
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
3340
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
1811
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
1221
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
276
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
3204
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
1107
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
2182
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
7134
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
7014
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
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7395
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
5485
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,...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.