diff --git a/queries.md b/queries.md index b06f900..bc9de03 100644 --- a/queries.md +++ b/queries.md @@ -8,6 +8,9 @@ ```sql -- Your Query Goes Here +SELECT books.title, authors.name +FROM books +INNER JOIN authors ON books.author_id = authors.id; ```
@@ -16,6 +19,9 @@ ```sql -- Your Query Goes Here +SELECT authors.name, books.title +FROM authors +LEFT JOIN books ON authors.id = books.author_id; ```
@@ -24,6 +30,9 @@ ```sql -- Your Query Goes Here +SELECT books.title, authors.name +FROM books +RIGHT JOIN authors ON books.author_id = authors.id; ```
@@ -32,6 +41,9 @@ ```sql -- Your Query Goes Here +SELECT books.title, authors.name +FROM books +FULL JOIN authors ON books.author_id = authors.id; ```
@@ -42,6 +54,9 @@ ```sql -- Your Query Goes Here +SELECT books.title, publishers.name, publishers.location +FROM books +INNER JOIN publishers ON books.publisher_id = publishers.id; ```
@@ -50,6 +65,9 @@ ```sql -- Your Query Goes Here +SELECT publishers.name, books.title +FROM publishers +LEFT JOIN books ON publishers.id = books.publisher_id; ```
@@ -58,6 +76,9 @@ ```sql -- Your Query Goes Here +SELECT books.title, publishers.name, publishers.location +FROM books +RIGHT JOIN publishers ON books.publisher_id = publishers.id; ```
@@ -66,6 +87,10 @@ ```sql -- Your Query Goes Here +SELECT authors.name AS author_name, books.title AS book_title, publishers.name AS publisher_name +FROM authors +FULL JOIN books ON authors.id = books.author_id +FULL JOIN publishers ON books.publisher_id = publishers.id; ```