Comment by maCDzP

2 days ago

I have found that ChatGTP and Claude are good at converting a picture of a schema to SQL. So I sketch the schema by hand and the LLM creates the SQL.

It can also save the picture as a mermaid text for future edits. Pretty neat.

I had the opposite problem, was given SQL ddl with near 1000 tables and hundreds of constraints, and had to produce the schema map. Ran the ddl and connected it to yEd, and hey presto, schema map!

  • The truth is that if you are modeling a relationship set of 1000 tables you probably cant usefully show that to someone - you can produce an image but nobody can likely use it.

    Instead, consider breaking things down to functional areas and then modeling those - just like how most city thinking is "well get on this main road and then this secondary road will get me to XYZ"

    • That's a good point, but to extend my situation, it's a client database I've been asked to transform. The map is indeed difficult to grok all in one, but using different views that come out of the box in yEd, along with some basic rules such as "make all nodes with the word 'cust' yellow", it's been surprisingly effective at exploring the schema.

"A picture of a schema"? What does this mean?

And by SQL do you mean DDL?

  • > "A picture of a schema"? What does this mean?

    A hand-drawn picture of a database schema. Something like this:

    https://www.dreamstime.com/stock-images-database-schema-imag...

    > And by SQL do you mean DDL?

    DDL is a subset of SQL, so the distinction is moot.

    • Huh, weird stuff!

      Your linked image shows what appear to be tables, and the little arrows appear to represent entity-relationships between them. But I'm not sure how you'd get useful DDL out of it -- none of the columns have types, no indices, etc.!

      Maybe an LLM could sketch out a DDL skeleton from a picture, which someone could use as a starting point?

      1 reply →