diff --git a/examples/db-problems-demo/.gitignore b/examples/db-problems-demo/.gitignore
new file mode 100644
index 00000000..549e00a2
--- /dev/null
+++ b/examples/db-problems-demo/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/examples/db-problems-demo/pom.xml b/examples/db-problems-demo/pom.xml
new file mode 100644
index 00000000..eec2be97
--- /dev/null
+++ b/examples/db-problems-demo/pom.xml
@@ -0,0 +1,79 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.3.4.RELEASE
+
+
+ ru.otus
+ db-problems-demo
+ 0.0.1-SNAPSHOT
+ db-problems-demo
+ Demo project for Db usage problems
+
+
+ 11
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+
+
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.flywaydb
+ flyway-core
+
+
+
+ com.h2database
+ h2
+ 1.4.200
+ test
+
+
+
+ org.postgresql
+ postgresql
+ 42.2.17
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.junit.vintage
+ junit-vintage-engine
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
diff --git a/examples/db-problems-demo/readme.md b/examples/db-problems-demo/readme.md
new file mode 100644
index 00000000..d70fff70
--- /dev/null
+++ b/examples/db-problems-demo/readme.md
@@ -0,0 +1 @@
+Проект с миграцией для демонстрации того, как выглядит джойн нескольких таблиц при связи "многие-ко-многим"
\ No newline at end of file
diff --git a/examples/db-problems-demo/src/main/java/db/migration/R__0002_Add_books.java b/examples/db-problems-demo/src/main/java/db/migration/R__0002_Add_books.java
new file mode 100644
index 00000000..84e9608b
--- /dev/null
+++ b/examples/db-problems-demo/src/main/java/db/migration/R__0002_Add_books.java
@@ -0,0 +1,60 @@
+package db.migration;
+
+import org.flywaydb.core.api.migration.BaseJavaMigration;
+import org.flywaydb.core.api.migration.Context;
+import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
+import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
+import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
+import org.springframework.jdbc.datasource.SingleConnectionDataSource;
+
+import javax.sql.DataSource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@SuppressWarnings("unchecked")
+public class R__0002_Add_books extends BaseJavaMigration {
+
+ public static final int BOOKS_COUNT = 100_000;
+
+ @Override
+ public void migrate(Context context) throws Exception {
+ DataSource ds = new SingleConnectionDataSource(context.getConnection(), true);
+ NamedParameterJdbcOperations jdbc = new NamedParameterJdbcTemplate(ds);
+
+ insertBooks(jdbc);
+ insertBooksRelations(jdbc);
+ }
+
+ private void insertBooks(NamedParameterJdbcOperations jdbc) {
+ List