-
Hierarchical query
Hi there,
I did not work much with Hierarchical queries.
To register a course, one have to complete the prerequisite courses. But the problem is for a single course to register there may be more then one course as a prerequisites.
For Example: to do ENG 105 course one need to complete ENG 100, and to finish course ITG 310 one need to complete two courses ITG 100, ITG 300. But for ITG 300 there is no prerequisites.
The present data structure is like below:
Course:
Course_Code, Course_Desc, Credit_Hours
Sample Course Table Data:
ENG 100, English I, 12
ENG 105, English II, 12
ITG 100, Computer Basics, 10
ITG 200, DBMS, 12
ITG 300, SQL & PL/SQL, 15
ITG 305, Oracle Admin I, 30
Course_Prerequisite:
Course_Code, Pre_Course_Code
Sample Course_Prerequsite Table Data:
ENG 105, ENG 100
ITG 300, ITG 200
ITG 305, ITG 100
ITG 305, ITG 300
I want the output if user wants to apply for course "ITG 305" as:
Code:
ITG 305
ITG 300
ITG 200
ITG 100
How can I accomplish this.
Note: The database structure can be changeable.
Thanks in advance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|