Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
grpatel authored Apr 25, 2024
1 parent 568b378 commit 7202fd7
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions content/03-types/02-relational/07-what-are-joins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,14 @@ t1.r3 + t2.r2
t1.r3 + t2.r3
```

<PrismaOutlinks>

In MySQL, the concept of a `CROSS JOIN` is combined with the `INNER JOIN`. Read more in the [data guide](https://www.prisma.io/dataguide/mysql/reading-and-querying-data/joining-tables#different-types-of-joins).
> **Note:** In MySQL, the concept of a `CROSS JOIN` is combined with the `INNER JOIN`. Read more in the [data guide](https://www.prisma.io/dataguide/mysql/reading-and-querying-data/joining-tables#different-types-of-joins).
</PrismaOutlinks>

With a `CROSS JOIN`, each row from the `customers` table is combined with each row from the `orders` table, resulting in 9 rows. However, we won’t show the result table as a `CROSS JOIN` wouldn’t accurately pair the customer with their respective orders.

<PrismaOutlinks>

💡 To learn more about JOINs in PostgreSQL, read more in the data guide [here](https://www.prisma.io/dataguide/postgresql/reading-and-querying-data/joining-tables). To learn more about JOINs in MySQL, read more in the data guide [here](https://www.prisma.io/dataguide/mysql/reading-and-querying-data/joining-tables).
To learn more about JOINs in PostgreSQL, read more in the data guide [here](https://www.prisma.io/dataguide/postgresql/reading-and-querying-data/joining-tables). To learn more about JOINs in MySQL, read more in the data guide [here](https://www.prisma.io/dataguide/mysql/reading-and-querying-data/joining-tables).

</PrismaOutlinks>

### LATERAL JOINs

Expand Down Expand Up @@ -283,15 +278,10 @@ In this case, the result would be the same as a `LEFT JOIN` and `FULL JOIN`.

## Implementing JOINs for different relations

It’s important to understand database relations when selecting the appropriate JOIN type. In the context of databases, relations describe a relationship between tables in a database. These are defined as relations within data models in the Prisma schema.
It’s important to understand database relations when selecting the appropriate JOIN type. In the context of databases, relations describe a relationship between tables in a database.

In this section, we will illustrate both the one-to-one and the one-to-many relations along with considerations for selecting the appropriate JOIN type for each.

<PrismaOutlinks>

You can learn more about relations in Prisma ORM [here](https://www.prisma.io/docs/orm/prisma-schema/data-model/relations).

</PrismaOutlinks>

### One-to-one (1-1)

Expand Down

0 comments on commit 7202fd7

Please sign in to comment.