From ced82b43aeb2b5775182a0597c8b96e422bf1df2 Mon Sep 17 00:00:00 2001 From: Geethu Pandath Ramesh Date: Mon, 2 Dec 2024 15:57:40 +0100 Subject: [PATCH] done --- queries.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/queries.md b/queries.md index b06f900..0396e9b 100644 --- a/queries.md +++ b/queries.md @@ -8,6 +8,12 @@ ```sql -- Your Query Goes Here + +SELECT books.title, authors.name +FROM books +INNER JOIN authors +ON books.author_id = authors.id; + ```
@@ -16,6 +22,11 @@ ```sql -- Your Query Goes Here +SELECT authors.name, books.title +FROM authors +LEFT JOIN books +ON authors.id = books.author_id; + ```
@@ -24,6 +35,12 @@ ```sql -- Your Query Goes Here + +SELECT books.title, authors.name +FROM books +RIGHT JOIN authors +ON authors.id = books.author_id; + ```
@@ -32,6 +49,11 @@ ```sql -- Your Query Goes Here +SELECT * +FROM books +FULL JOIN authors +ON authors.id = books.author_id; + ```
@@ -42,6 +64,11 @@ ```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 +77,11 @@ ```sql -- Your Query Goes Here +SELECT publishers.name, books.title +FROM publishers +LEFT JOIN books +ON publishers.id = books.publisher_id; + ```
@@ -58,6 +90,12 @@ ```sql -- Your Query Goes Here +SELECT books.title, publishers.name +FROM books +RIGHT JOIN publishers +ON books.publisher_id = publishers.id; + + ```
@@ -66,6 +104,13 @@ ```sql -- Your Query Goes Here +SELECT * +FROM authors +FULL JOIN books +ON authors.id = books.author_id +FULL JOIN publishers +ON books.publisher_id = publishers.id; + ``` -
+