Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

```sql
-- Your Query Goes Here
SELECT *
FROM books
INNER JOIN authors
ON books.author_id=authors.id;
```

<br>
Expand All @@ -16,6 +20,10 @@

```sql
-- Your Query Goes Here
SELECT *
FROM authors
LEFT JOIN books
ON authors.id = books.author_id;
```

<br>
Expand All @@ -24,6 +32,10 @@

```sql
-- Your Query Goes Here
SELECT *
FROM books
RIGHT JOIN authors
ON books.author_id = authors.id;
```

<br>
Expand All @@ -32,16 +44,22 @@

```sql
-- Your Query Goes Here
SELECT *
FROM books
FULL OUTER JOIN authors
ON books.author_id = authors.id;
```

<br>

## BONUS: Iteration 3 - Joins (continued)

@@ -41,31 +53,45 @@
1. Using an **INNER JOIN**, list all books (left table) and their corresponding publishers on the (right table). The result should include the book's title, publisher's name, and location.

```sql
-- Your Query Goes Here
SELECT books.title, publishers.name, publishers.location
FROM books
INNER JOIN publishers
ON books.publisher_id=publishers.id;
```

<br>
Expand All @@ -50,6 +68,10 @@

```sql
-- Your Query Goes Here
SELECT *
FROM publishers
LEFT JOIN books
ON publishers.id=books.publisher_id;
```

<br>
Expand All @@ -58,6 +80,10 @@

```sql
-- Your Query Goes Here
SELECT *
FROM publishers
RIGHT JOIN books
ON books.publisher_id = publishers.id;
```

<br>
Expand All @@ -66,6 +92,12 @@

```sql
-- Your Query Goes Here
SELECT *
FROM authors
FULL OUTER JOIN books
ON authors.id = books.author_id
FULL OUTER JOIN publishers
ON publishers.id = books.publisher_id;
```

<br>
<br>