473,624 Members | 2,298 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 1214
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****@flashin dia.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
3124
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 code, to learn from, and also avoid re-inventing the wheel, does anyone know of any existing source that implements a (basic or complex) play-by-email system using PHP and maybe MYSQL?
6
3349
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 be sent to the server and stored in the database as the .asp page calls itself on Submit. How secure is this? I've never had to worry about it before but is form information encrypted before being sent to the server? Are there any legal...
2
1824
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. (4,000 entries) Name-Phone-Addres-Email-Country-Language-University-Age Database Be has the following fields: (2,000 entries)
0
1226
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 database. The individual records are being saved to the database with a few issues... Notes: 1) I was going to post the source code from a test program I developed for testing these issues, but it made for a messy post. Here is a link to a zip...
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 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...
10
3230
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. Behind this form is the tblUserDetails, which has login information such as: userID, password and access level (which has three levels: basic/full/admin). Problem: Once the user has logged in I would like to be able to retrieve their userID and...
1
1114
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 to correlate each user to their company so I know what connection string (which I want to store in the membership database as well) to use to get their data. Please note that my users will not be able to create their own profiles over the web. ...
5
2192
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 Date Time 1 37 'Clockin' 1/18/08 7:45:39 AM 2 38 'Clockin' 1/18/08 7:55:42 AM 3 39 'Clockin' 1/18/08 7:55:42 AM 4 38 'BreakOut' 1/18/08 ...
0
8242
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8681
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7170
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
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 we have to send another system
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.