Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. design a database to store an expression tree [modified]

design a database to store an expression tree [modified]

Scheduled Pinned Locked Moved Database
databasehtmlcomdesigndata-structures
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deostroll
    wrote on last edited by
    #1

    Hi, I need some help with the database design for storing an expression tree. It should basically store a whole expression. I'd want to query out data (in one or more result sets as necessary) so that I can finally evaluate it somehow in my front-end application. Just kind of need a table(s) structure to store and represent the relationship. The expressions I plan to store in the database will be mostly logical expressions. Meaning they'd evaluate to a true or false mostly. Here is a diagrammatic representation of what I want (as a result set(s)).

    modified on Thursday, March 4, 2010 8:31 AM

    M 1 Reply Last reply
    0
    • D deostroll

      Hi, I need some help with the database design for storing an expression tree. It should basically store a whole expression. I'd want to query out data (in one or more result sets as necessary) so that I can finally evaluate it somehow in my front-end application. Just kind of need a table(s) structure to store and represent the relationship. The expressions I plan to store in the database will be mostly logical expressions. Meaning they'd evaluate to a true or false mostly. Here is a diagrammatic representation of what I want (as a result set(s)).

      modified on Thursday, March 4, 2010 8:31 AM

      M Offline
      M Offline
      Mschauder
      wrote on last edited by
      #2

      Hi, I often use trees and what you essentially needs is the ID and Parent ID for example: ID | ParentID | Name 1 | 0 | A 2 | 1 | AA 3 | 1 | AB 4 | 0 | B 5 | 4 | BA 6 | 4 | BB looks like: [] | -A --AA --AB -B --BA --BB and so on... ... I hope you mean this :doh:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups