From dcadee52ce5953422f4909c68eb6bf64b2d2d560 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Sat, 9 Nov 2024 23:10:17 +0530 Subject: [PATCH] Fixed union query since union combines results from two queries, but the number of columns and their data types must match. --- Practical/Practical Exam/SQL/S8 - SQL Queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Practical/Practical Exam/SQL/S8 - SQL Queries.md b/Practical/Practical Exam/SQL/S8 - SQL Queries.md index 8ceb742..6d56849 100644 --- a/Practical/Practical Exam/SQL/S8 - SQL Queries.md +++ b/Practical/Practical Exam/SQL/S8 - SQL Queries.md @@ -90,7 +90,7 @@ SELECT name, cost, domain, quantity FROM Companies RIGHT JOIN Orders on Companie 4. Find names, costs, domains and quantities for companies using Union operator. ```sql -SELECT name, cost FROM Companies UNION SELECT domain, quantity FROM Orders; +SELECT name AS info, cost AS value FROM Companies UNION SELECT domain AS info, quantity AS value FROM Orders; ```