Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For the attached query, i have written the below code. WITH BookCounts AS ( SELECT COUNT ( b . bookid ) AS Count, CONCAT (
For the attached query, i have written the below code.
WITH BookCounts AS
SELECT
COUNTbbookid AS Count,
CONCATafirstname, alastname AS AuthorName,
ppublishername AS PublisherName
FROM
Book b
JOIN
Author a ON bauthorid aauthorid
JOIN
Publisher p ON bpublisherid ppublisherid
GROUP BY
afirstname, alastname, ppublishername
HAVING
COUNTbbookid
SELECT FROM BookCounts
UNION ALL
SELECT AS Count, 'Thomas Cook' AS AuthorName, 'ABSPublisher' AS PublisherName;
This is my output:
COUNT AUTHORNAME PUBLISHERNAME
Harvey Deitel Prentice Hall
Harvey Deitel Prentice Hall PTG
Paul Deitel Prentice Hall
Sean Santry Prentice Hall
Tem Nieto Prentice Hall
Tem Nieto Prentice Hall PTG
Thomas Cook ABSPublisher
Still the testcase is failing, Can you please help to fix this,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started