473,799 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extending a old DB - clever experts required for advice

Summary (still get coffee) explanation:

I have added a new "Sessions" table to a DB because the original design
could not handle a scenario where an entity "class" had a number of
sessions. Originally there was just one class which would be attended
by people, as they got more popular they had to split out classes over
different sessions because too many people would attend a class.
However, the database used to store what people attended what class can
only store just that. There was no way of knowing who attended a
particular session that belongs to class.

Hope that makes sense so far.

OK so the first step was to create a new table called sessions which
would also store what sessions people attended. As there was a table
called Classlink which would store what people attended each class, if
we are creating a session table, we also need a SessionLink table so we
can store what people attended what sessions (I assume this is a good
way to do it).

Why do we still need the ClassLink table you may ask? Because in some
scenarios, the class may have been sorted people have been recruited
for it, but the actual sessions have not yet been defined, so you still
need to know who has been recruited for the Class. (Also there is the
legacy aspect of how the PHP and My Sql DB used to work, if I change
things with the old code I will have to do a lot more checking)

So I think I have the option:
a) When a person attends a class, store this fact in both the new
SessionLink and the ClassLink table. Therefore when you want to see who
attended a class, all you have to do is look in the ClassLink table and
you will have the full list, without then having to look into the
Sessionlink table to see who attended sessions associated with that
class.
b) Store a members attendance only in the Classlink table if it is not
determined which session a person is attending. When the person is
moved to a session, the row will be removed from the classlink table
into the session link to show what specific session the person
attended. This means to work what people attended a class, not only do
you have to check the class table for attendees, you then have to find
the session numbers associated with the class and then check the
sessionlink table for sessions associated with those classes and then
get them as well.
I am a bit concerned that SQL involved here might make things a bit
confusing.
This method does also has the benefit of all the current data in DB was
still be compatible with current code.

c) As I was writing this another option occurred to me. I could extend
the the current classlink table to have a new fields, sessionID and
isItaSession (not strictly necessary because a Null value in session ID
could indicate the row does not indicate a session).
This way when a person is moved into a specific session for a class, a
value is just filled into sessionID field. In fact the primary key on
the SessionDetails table could be a combination of the sessionID and
ClassID fields.
This means when I want to see who attended a class, I am only searching
one table (classlink using the original class_id field), if I Want to
see who attended a particular session for a class, I can search the
classlink table for the classID combined with the session ID and I will
get my list.
So which approach is best? This is probably all a bit confusing with
the information I have given so if you have made sense of what I have
written the I appreciate it. If I have managed to make myself clear in
a succinct way then I would welcome any DB designers opinion on this
matter on what is the best approach and some ideas on what sort of SQL
would be needed if I go for option b

Kind regards and thank you if you even read this far.

Dave

Jul 23 '05 #1
0 1045

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

Similar topics

4
4157
by: Paul Moore | last post by:
I hit a problem yesterday with my mail connection. In a desparate attempt to understand what was going on, I wanted to log the connection traffic. After a bit of searching, I found a post on c.l.p from Andrew Bennetts explaining how to run a port forwarder in 2 lines using Twisted. $ mktap portforward -p 8000 -h remote -d 20 $ twistd -f portforward.tap This looked brilliant - all I needed to do was add logging. A quick
75
3908
by: David MacQuigg | last post by:
Seems like we need a simple way to extend Python syntax that doesn't break existing syntax or clash with any other syntax in Python, is easy to type, easy to read, and is clearly distinct from the "base" syntax. Seems like we could put the @ symbol to good use in these situations. Examples: print @(separator = None) x, y, z @x,y:x*x+y*y -- anonymous function
22
2571
by: ByteSize | last post by:
Dear All, Please, this is not meant to be offensive - but it is a challenge !!! I have posted on over a dozen so called 'vb.net' expert / blog sites - in the vain hope of finding a complete, accurate and ACTUALLY FUNCTIONING snippet to demonsrate a successful api call to CreateProcess() using VB.NET. So far NO ONE has taken up the challenge - not even MSDN or MS personnel. I have code that works in vb6, I have dilligently tried to...
17
3629
by: cwdjrxyz | last post by:
Javascript has a very small math function list. However there is no reason that this list can not be extended greatly. Speed is not an issue, unless you nest complicated calculations several levels deep. In that case you need much more ram than a PC has to store functions calculated in loops so that you do not have to recalculate every time you cycle through the nest of loops. Using a HD for storage to extend ram is much too slow for many...
1
1048
by: Mike | last post by:
I'm a fairly intelegent guy by most standards, but I find picking up programming to be a paradigm shift from my daily routine of IT support. It is not always an easy paradigm to shift into. I periodically get frustrated by all of requisite terms and technologies required to "master" the concepts. It reminds me of those "Choose Your Own Adventure" books I used to read as a kid. Today it is string processing, tomorrow it is XML/XSLT, the...
8
5444
by: Mark Olbert | last post by:
I'm writing a custom MembershipProvider which uses a custom class derived from MembershipUser (basically, the derived class adds a field to the MembershipUser base class). When I try to configure my website using the ASP.NET Configuration tool, and go to the Security page, I get the following error: Could not load type 'OMLMembershipUser' from assembly 'App_Code.olsckwwk, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Yet...
2
1473
by: bjhartin | last post by:
Hello all, I am having a problem with extending complex types. I have a simple base schema (FooBar.xsd) which defines XML documents of the following form: <Foo FooAttribute1="aaa"> <Bar BarAttribute1="xxx"/> </Foo>
3
1809
by: Redefined Horizons | last post by:
I'm trying to understand the argument flags that are used in the method table of an extension module written in C. First let me ask this question about the method table. Is it an C array named "PyMethodDef"? Now, onto my questions about the arguments: I see that even when the Python function we are supplying takes no arguments, (the argument flag is METH_NOARGS), that we still pass the
13
2125
by: interec | last post by:
I have some code in Java that I need to translate into C++. My Java code defines a class hierarchy as follows: // interface IA public interface IA { public abstract void doA(); } // interface IB
7
4092
by: Spectrum | last post by:
I am writing some Python code using the Message Passing Interface (MPI), an API used in parallel computing. There exist a number of Python implementations of MPI, but apparently they all rely on the Numeric Python (numpy) package. I need to run my code on a particular machine made available by my university, which does not have numpy and will not be getting it. So I am trying to write my own mini-wrapper for MPI in C to extend my Python...
0
9687
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
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10252
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...
1
10231
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
10027
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...
0
9073
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
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
2
3759
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.