473,395 Members | 1,502 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,395 software developers and data experts.

Table(s) layout

Hi All

I am pretty new to databases and would really appreciate some help.
The problem is that im trying to create a database that will give the
names of pupils at my school with relation to the subjects that they
are studying.

e.g. Show everyone that is taking Biology and Geography,
Show everyone that is taking a science etc

I thought of having tables that look like this

LanguagesTbl
ID Language
1 English
2 French
3 German

ScienceTbl
ID Science
1 Physics
2 Biology
3 Chemistry

PupilTbl
ID Surname Forname etc.................
1 Smith John

Im having a problem trying to think how i can connect each pupil to
their subject and still allow flexabililty if new subjects were added
to the database. ie Do i put the ID numbers of each subject the pupils
are taking into the PupilTbl (would this not make the table huge, as
it has to take all variations into account)

Can anyone shed some light?

Many Thanks

Neil
Nov 12 '05 #1
3 1340
You need a Courses table, not separate tables for categories of studies. If
you need to categorize the Courses, you can create a Categories table to
join with the Courses in order to select. Then, because you have a many to
many relationship between the Students and Courses tables, you'll need a
"junction" or "intersection" table that has foreign key fields pointing to
the Students table and the Courses table.

Getting the information you want, then, will be a relatively simple matter
of using the Query Builder to create Queries.

I caution you, if you use the Table (or table name) as though it were data,
as you have in your example, you will pay the price later in difficulty
Querying and handling the information in your database application.

Also, the most common naming convention used with Access is the Reddick
naming convention, a "descendent" of the Leszynski-Reddick naming convention
introduced back in the early days of Access 1.1 or 2.0. That includes
prefixes that indicate the type of object (where you used suffixes; some
will tell you that it really doesn't matter what convention you use as long
as you are consistent. My experience indicates that it does matter, if you
exchange your work with others, or discuss it here in the newsgroup -- if
you use the commonly-used naming system, that communication will be
enhanced. You'll find it at
http://www.triadconsulting.com/Resources/Reddick.htm.

Larry Linson
Microsoft Access MVP

"NeilH" <ne**********@ntlworld.com> wrote in message
news:75*************************@posting.google.co m...
Hi All

I am pretty new to databases and would really appreciate some help.
The problem is that im trying to create a database that will give the
names of pupils at my school with relation to the subjects that they
are studying.

e.g. Show everyone that is taking Biology and Geography,
Show everyone that is taking a science etc

I thought of having tables that look like this

LanguagesTbl
ID Language
1 English
2 French
3 German

ScienceTbl
ID Science
1 Physics
2 Biology
3 Chemistry

PupilTbl
ID Surname Forname etc.................
1 Smith John

Im having a problem trying to think how i can connect each pupil to
their subject and still allow flexabililty if new subjects were added
to the database. ie Do i put the ID numbers of each subject the pupils
are taking into the PupilTbl (would this not make the table huge, as
it has to take all variations into account)

Can anyone shed some light?

Many Thanks

Neil

Nov 12 '05 #2
Thanks for your help

After your advice, I am thinking of having tables that look like this

CoursesTbl
CourseID Course
1 Chemistry
2 Physics
3 French
4 English
5 History
etc etc

CategoryTbl
CategoryID Category
1 Science
2 Languages
3 Humanities
etc etc

CourseCategortyTbl
CourseID CategoryID
1 1
2 1
3 2
4 2
5 3

I am still struggling try to work out how i can assign several course
ID's to one student

PupilTbl
PupilID Surname Forname CourseID?
1 Smith John need to have several

How would i have a varying amount of categories without making the
table have alot of columns

many thanks again
Neil
"Larry Linson" <bo*****@localhost.not> wrote in message news:<8e***********@nwrddc02.gnilink.net>...
You need a Courses table, not separate tables for categories of studies. If
you need to categorize the Courses, you can create a Categories table to
join with the Courses in order to select. Then, because you have a many to
many relationship between the Students and Courses tables, you'll need a
"junction" or "intersection" table that has foreign key fields pointing to
the Students table and the Courses table.

Getting the information you want, then, will be a relatively simple matter
of using the Query Builder to create Queries.

I caution you, if you use the Table (or table name) as though it were data,
as you have in your example, you will pay the price later in difficulty
Querying and handling the information in your database application.

Also, the most common naming convention used with Access is the Reddick
naming convention, a "descendent" of the Leszynski-Reddick naming convention
introduced back in the early days of Access 1.1 or 2.0. That includes
prefixes that indicate the type of object (where you used suffixes; some
will tell you that it really doesn't matter what convention you use as long
as you are consistent. My experience indicates that it does matter, if you
exchange your work with others, or discuss it here in the newsgroup -- if
you use the commonly-used naming system, that communication will be
enhanced. You'll find it at

Nov 12 '05 #3
tblCourse
courseId autoNumber (pk)
course text
categoryId long integer (fk)

tblCategory
categoryId autoNumber (pk)
category text

tblPupil
pupilId autoNumber (pk)
firstName text
lastName text
tblPupilCourse
pupilId long integer (fk)
courseId long integer (fk)

ne**********@ntlworld.com (NeilH) wrote in message news:<75**************************@posting.google. com>...
Thanks for your help

After your advice, I am thinking of having tables that look like this

CoursesTbl
CourseID Course
1 Chemistry
2 Physics
3 French
4 English
5 History
etc etc

CategoryTbl
CategoryID Category
1 Science
2 Languages
3 Humanities
etc etc

CourseCategortyTbl
CourseID CategoryID
1 1
2 1
3 2
4 2
5 3

I am still struggling try to work out how i can assign several course
ID's to one student

PupilTbl
PupilID Surname Forname CourseID?
1 Smith John need to have several

How would i have a varying amount of categories without making the
table have alot of columns

many thanks again
Neil
"Larry Linson" <bo*****@localhost.not> wrote in message news:<8e***********@nwrddc02.gnilink.net>...
You need a Courses table, not separate tables for categories of studies. If
you need to categorize the Courses, you can create a Categories table to
join with the Courses in order to select. Then, because you have a many to
many relationship between the Students and Courses tables, you'll need a
"junction" or "intersection" table that has foreign key fields pointing to
the Students table and the Courses table.

Getting the information you want, then, will be a relatively simple matter
of using the Query Builder to create Queries.

I caution you, if you use the Table (or table name) as though it were data,
as you have in your example, you will pay the price later in difficulty
Querying and handling the information in your database application.

Also, the most common naming convention used with Access is the Reddick
naming convention, a "descendent" of the Leszynski-Reddick naming convention
introduced back in the early days of Access 1.1 or 2.0. That includes
prefixes that indicate the type of object (where you used suffixes; some
will tell you that it really doesn't matter what convention you use as long
as you are consistent. My experience indicates that it does matter, if you
exchange your work with others, or discuss it here in the newsgroup -- if
you use the commonly-used naming system, that communication will be
enhanced. You'll find it at

Nov 12 '05 #4

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

Similar topics

9
by: alex | last post by:
Hi, It seems like HTML 4.01 Transitional spec. doesn't allow table height to be expressed in percents. When i have this doctype tag: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01...
61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
7
by: mr_burns | last post by:
hi, is the table percent value for height used for displaying in browsers. i have a table i want to run to the bottom of the screen so it seemed best to set the height value to 100%. when i...
39
by: Zak McGregor | last post by:
Hi all Are there any good solutions to aligning form field names and input boxes without resorting to tables? I am struggling to do this nicely at the moment. Thanks Ciao Zak
12
by: Rick DeBay | last post by:
I'm trying to create a layout table, where the spacing between rows varies. I've tried using setting margin-top and border-top for the rows I wan't spaced down from the one above, and I've also...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
16
by: Michael Rozdoba | last post by:
I'm far from a CSS expert, but what I see of it I really like & I love keeping content & style separate. I also hate the way table layout produces convoluted bulky code. However when asked why...
4
by: Rob Freundlich | last post by:
I have some servlet-generated tabular data that I need to present, so I'm using an HTML Table. In some cases, it can be quite large. I'm flushing the servlet output every N lines to push the data...
7
by: ALI-R | last post by:
Hi All, I have two user controls (header and footer) ,,which I've placed in an HTML Table in a page.I set the **align="center"** in the table and the table still is on the left side of the page...
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.