Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 45153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:45:51+00:00 2026-05-10T15:45:51+00:00

I am looking to implement a data-driven wizard with the question tree stored in

  • 0

I am looking to implement a data-driven wizard with the question tree stored in an Oracle database. What is the best schema to use to make the database portion flexible (i.e. easy to add new paths of questions) without sacrificing too much in terms of performance?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:45:52+00:00Added an answer on May 10, 2026 at 3:45 pm

    You can build a tree structure using a foreign key that references the same table (a ‘pig’s ear’ relationship as it is often known). Then you can use the CONNECT BY syntax to traverse the tree. Here is a simple example:

    SQL> create table qs   2  ( q_id integer primary key   3  , parent_q_id integer references qs   4  , parent_q_answer varchar2(1)   5  , q_text varchar2(100)   6* );  Table created.  SQL> insert into qs values (1, null, null, 'Is it bigger than a person?');  1 row created.  SQL> insert into qs values (2, 1, 'Y', 'Does it have a long neck?');  1 row created.  SQL> insert into qs values (3, 2, 'Y', 'It is a giraffe');  1 row created.  SQL> insert into qs values (4, 2, 'N', 'It is an elephant');  1 row created.  SQL> insert into qs values (5, 1, 'N', 'Does it eat cheese?');  1 row created.  SQL> insert into qs values (6, 5, 'Y', 'It is a mouse');  1 row created.  SQL> insert into qs values (7, 5, 'N', 'It is a cat');  1 row created.  SQL> commit;  Commit complete.  SQL> select rpad('    ',level*4,' ')||parent_q_answer||': '||q_text   2  from qs   3  start with parent_q_id is null   4  connect by prior q_id = parent_q_id;  RPAD('',LEVEL*4,'')||PARENT_Q_ANSWER||':'||Q_TEXT ------------------------------------------------------------------------------------------------------------------------------     : Is it bigger than a person?         Y: Does it have a long neck?             Y: It is a giraffe             N: It is an elephant         N: Does it eat cheese?             Y: It is a mouse             N: It is a cat  7 rows selected. 

    Note how the special keyword LEVEL can be used to determine how far down the tree we are, which I have then used to indent the data to show the structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer First, here's a link to the documentation: http://developer.apple.com/iPhone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_shadows/dq_shadows.html#//apple_ref/doc/uid/TP30001066-CH208-TPXREF101 Next, try… May 11, 2026 at 8:23 pm
  • Editorial Team
    Editorial Team added an answer Just to counter Brian's claim, rewritten code from leppie's answer… May 11, 2026 at 8:23 pm
  • Editorial Team
    Editorial Team added an answer You can use SchemaExport class to export SQL schema. new… May 11, 2026 at 8:23 pm

Related Questions

I'm looking for thoughts on how should I use Session in an ASP.NET MVC
I am looking for best practices to implement a TraceListener that will write logs
I have a large database and want to implement a feature which would allow
I have the following situation: class A { public: A(int whichFoo); int foo1(); int

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.