473,626 Members | 3,392 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 1215
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
8262
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...
1
8364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
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
4090
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2623
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
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
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.