title: How to model a Bayesian network or, more generally, a directed weighted graph, in SQL?
body: <p>I found a few articles online providing examples of how to model graphs of various kinds (DAGs, in particular) in SQL, but they all seemed enormously complex, given the relative simplicity of what they're modeling.</p>
  
  <p>Is there a best / standard way of doing this? My current thinking is something like this:</p>
  
  <pre><code>create table node (
    id int not null auto_increment,
    name TEXT
  )
  
  create table edge (
    from_node int not null,
    to_node int not null,  
    weight float
  ) 
  </code></pre>
  
  <p>Is there anything wrong with that? Anyone know of a better (more robust, perhaps) way?</p>