10. For each book with coauthors, list the title, publisher code, type, and author names (in the order listed on the cover).

SELECT BookCode FROM `Wrote` GROUP BY BookCode HAVING COUNT(*)>1;

SELECT AuthorFirst , AuthorLast , PublisherCode , Title, Type FROM Author, Wrote, Book WHERE AuthorNum = AuthorNum AND BookCode = BookCode ;

SELECT AuthorFirst , AuthorLast , PublisherCode , Title, Type FROM Author, Wrote, Book WHERE AuthorNum = AuthorNum AND BookCode = BookCode AND BookCode IN (SELECT BookCode FROM `Wrote` GROUP BY BookCode HAVING COUNT(*)>1);

SELECT AuthorFirst , AuthorLast , PublisherCode , Title, Type FROM Author, Wrote, Book WHERE AuthorNum = AuthorNum AND BookCode = BookCode AND BookCode IN (SELECT BookCode FROM `Wrote` GROUP BY BookCode HAVING COUNT(*)>1) ORDER BY Sequence;

SELECT AuthorFirst , AuthorLast , PublisherCode , Title, Type FROM Author, Wrote, Book WHERE AuthorNum = AuthorNum AND BookCode = BookCode AND BookCode IN (SELECT BookCode FROM `Wrote` GROUP BY BookCode HAVING COUNT(*)>1) ORDER BY BookCode , Sequence;

14. For each book copy with a price greater than $25, list the book’s title, quality, and price.

SELECT Book.Title, Quality, Price FROM Book,Copy WHERE BookCode = BookCode AND Price>25;

What langauges spoken in ...

SELECT * FROM `Country` WHERE Name IN ("United States", "Brazil", "Mexico")

SELECT Language FROM `CountryLanguage` WHERE CountryCode in (SELECT CountryCode FROM `Country` WHERE Name IN ("United States", "Brazil", "Mexico"))

Topic revision: r2 - 2013-10-07 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback