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 #2

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
38 changes: 37 additions & 1 deletion queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@

```sql
-- Your Query Goes Here
select * from books
inner join authors
on books.author_id = authors.id;
```

<br>

2. Using a **LEFT JOIN**, list all authors (left table) and their corresponding books on the (right table). The result should include all authors, including those who don't have any books assigned.

```sql
-- Your Query Goes Here
select * from authors
left join books
on authors.id = books.author_id;
```

<br>
Expand All @@ -24,6 +29,12 @@

```sql
-- Your Query Goes Here

select * from books
right join authors
on books.author_id = authors.id;


```

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

```sql
-- Your Query Goes Here
select * from books
full join authors
on books.author_id = authors.id;

```

<br>
Expand All @@ -42,6 +57,11 @@

```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 +70,10 @@

```sql
-- Your Query Goes Here
select *
from publishers
left join books
on publishers.id = books.publisher_id
```

<br>
Expand All @@ -58,6 +82,11 @@

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

```

<br>
Expand All @@ -66,6 +95,13 @@

```sql
-- Your Query Goes Here
SELECT *

FROM books
full join publishers
ON books.publisher_id = publishers.id
full join authors
on books.author_id = authors.id
```

<br>