Ask a Question related to Coldfusion Database Access, Design and Development.
-
Ryunosuke #1
SQL query and possible relation
i have a problem about the DB relation. for information, i'm using MS Access.
The problem is, how can i refer the foreign key to another primary key? let me
show it clearly. I have 2 tables in one DB. I name it as a tbl_modul and
tbl_dftr_mod.
The contents in these tables:
tbl_modul
id | code | subject |
-----------------------------------------------
1 A1001 Math
2 A1002 Science
3 A3300 Biology
tbl_dftr_mod
id_std | code1 | code2 | code3 -->> code15
-------------------------------------------------------------
F102 A1001 A1002
F103 A3300
Ryunosuke Guest
-
recursive relation in datagrid
I have a table with this structure itemID naam image parentID I want to make a datagrid that contains a hyperlinkcolumn. When i click on the... -
Can't find relation oid
Hi, I have the following problem: I use libpq inside SRF functions (like in dblink) and I create some tables to store results coming from... -
C function taking a relation and returning a similar relation.
Hi, Please CC me as I'm not on the list. I'm trying to write a closed frequent itemset data mining custom function for postgresql. The optimal... -
[PHP-DEV] some public relation for php 5
*This message was transferred with a trial version of CommuniGate(tm) Pro* Hi all, after the RC/Beta-discussion of php5 i habe set up a separate... -
Positioning MIAWs in relation to the Stage
I am working with MIAWs as pop up panels. Is it possible to position the MIAWs. i.e. define the rect points in relation to the stage position rather... -
mxstu #2
Re: SQL query and possible relation
I think a better structure would be to use three tables: "module", "student"
and "studentModule". The the third table "studentModule" would contain the
modules (zero or more) for each student. Note - that the foreign keys in this
table are the numeric student and module record Id's not their string "codes"
MODULE
moduleId | code | subject |
-----------------------------------------------
1 A1001 Math
2 A1002 Science
3 A3300 Biology
STUDENT
studentId | code
-------------------------------------------------------------
1 F102
2 F103
STUDENTMODULE
id | studentId | moduleId
-------------------------------------------------------------
1 | 1 | 1 <!--- Student F102, A1001 Math
1 | 1 | 2 <!--- Student F102, A1002 Science
1 | 2 | 3 <!--- Student F103, A3300 Biology
With this structure you can easily query the three tables to retrieve the
information you need and can use the GROUP attribute of CFOUTPUT to format the
output as desired.
mxstu Guest



Reply With Quote

