I want to ask a question on this site.

The good news. It is just a simple question which needs a 1:N relation.

To make the question easier to understand I want to add this:

  • INSERT ....

Are there canonical examples which I just need to copy+paste?

What I want: Common words, common example tables

I think it would help new comers if you have some common tables. I guess 90% of all SQL question can be answered by using these example tables:

  • user
  • group
  • user_groups (N:M)

If there is a common ground, questions are easier to read for experts, too.

  • Unfortunately I can't give a bounty for this question. I would, if I could, since I think an answer to this question would bring a major benefit for all new comers.
    – guettli
    Apr 18, 2017 at 8:07

3 Answers 3


Why use canonical examples when you can just provide real examples via dbfiddle.uk? Even if the question is a generic architecture question or something purely academic in nature, the OP still likely prefers one DB solution over others and I think tangible examples are much easier to work with and understand for all parties.

  • 1
    The question was about a sample schema with sample data. Yes, dbfiddle is great.
    – guettli
    Apr 10, 2018 at 15:29

I found this to be useful: http://www.postgresqltutorial.com/postgresql-sample-database/

It has 15 tables and an ERP diagramm.

enter image description here


Just for the records, this question has a simple N:M model (user, groups) which is simple and could serve as template for many SQL questions.

Subselect vs join: Are both SQL queries equal?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .