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

  • SEARCH
  • Home
  • 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 7615007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:32:53+00:00 2026-05-31T02:32:53+00:00

Some people like describing their database structure in a simple textual way instead of

  • 0

Some people like describing their database structure in a simple textual way instead of using CREATE TABLE statements. A few example:

  • Foreign key as Primary key
  • Multiple Primary Keys as single foreign key
  • How can I set up a database schema where there are two concurrent many-many relationships?
  • primary key and foreign key
  • How should I set up database tables for this order situation

Do you know about any software which converts this kind of shorthand notation to actual SQL statements?

  • 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. Editorial Team
    Editorial Team
    2026-05-31T02:32:54+00:00Added an answer on May 31, 2026 at 2:32 am

    Actually, I just finished creating a php script, which does exactly this, but I hope there is something more professional out there…

    Demo of my converter:

    http://simpleddl.orgfree.com

    Example input:

    = ID id P AI
    
    person
      ID
      mother_id -> person
      father_id -> person
      !FK mother_id, father_id -> family U:C, D:C
    
    family
      P female_id -> person
      P male_id   -> person
    

    Output:

    CREATE TABLE IF NOT EXISTS person (
       id         INT NOT NULL AUTO_INCREMENT,
       mother_id  INT NOT NULL,
       father_id  INT NOT NULL,
       PRIMARY KEY ( id )
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
    
    CREATE TABLE IF NOT EXISTS family (
       female_id  INT NOT NULL,
       male_id    INT NOT NULL,
       PRIMARY KEY ( female_id, male_id )
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
    
    ALTER TABLE person ADD FOREIGN KEY ( mother_id ) REFERENCES person( id );
    ALTER TABLE person ADD FOREIGN KEY ( father_id ) REFERENCES person( id );
    ALTER TABLE person ADD FOREIGN KEY ( mother_id, father_id ) REFERENCES family( female_id, male_id ) ON DELETE CASCADE ON UPDATE CASCADE;
    
    ALTER TABLE family ADD FOREIGN KEY ( female_id ) REFERENCES person( id );
    ALTER TABLE family ADD FOREIGN KEY ( male_id ) REFERENCES person( id );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see some people do joins like this SELECT * FROM table1 JOIN table
I see some people design design their database having a column STATUS INT where
Can some people exchange their experiences about the learning curve of frameworks like Apache
Seems like it would be a good way to introduce some people to unit
I'm new to using XAMPP so this may be simple to some people. I
Some people don't like sequences on Oracle. Why? I think they are very easy
I am making a program like yelp. Some people have some accounts. So I
Some people want to see the DB structure and dont have VS, is there
Some people set default src to img element in the following way: <img src=foo.jpg
I've seen some people use the maven-sql-plugin to do this. But it seems like

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.