列出發佈平裝書的發佈者和每個發佈的平裝書數量。 我在計算每個出版商的平裝書時遇到困難。任何幫助都感激不盡。謝謝!什麼是以下任務的SQL語句:
亨利書籍表模式
**author**
authorNum INT PRIMARY KEY
authorLast VARCHAR(12),
authorFirst VARCHAR(10)
**publisher**
publisherCode CHAR(3) PRIMARY KEY
publisherName VARCHAR(25)
city VARCHAR(20)
**book**
bookCode CHAR(4) PRIMARY KEY
title VARCHAR(40)
publisherCode CHAR(3)
bookType CHAR(3)
paperback ENUM('No', 'Yes')
CONSTRAINT book_fk_publisher
FOREIGN KEY (publisherCode)
REFERENCES publisher(publisherCode)
**branch**
branchNum INT
branchName VARCHAR(50)
branchLocation VARCHAR(50)
**copy**
bookCode CHAR(4)
branchNum INT
copyNum INT PRIMARY KEY
quality ENUM('Excellent', 'Fair', 'Good', 'Poor')
price DECIMAL(8,2)
CONSTRAINT copy_pk
PRIMARY KEY (bookCode, branchNum, copyNum
CONSTRAINT copy_fk_book
FOREIGN KEY (bookCode)
REFERENCES book(bookCode),
CONSTRAINT copy_fk_branch
FOREIGN KEY (branchNum)
REFERENCES branch(branchNum)
**wrote**
bookCode CHAR(4)
authorNum INT
sequence INT
PRIMARY KEY (BookCode, AuthorNum),
CONSTRAINT wrote_fk_book
FOREIGN KEY (bookCode)
REFERENCES book(bookCode),
CONSTRAINT wrote_fk_author
FOREIGN KEY (authorNum)
REFERENCES author(authorNum)
這是我有:
SELECT publisherName, COUNT(paperback) AS "numPaperback"
FROM publisher, book
WHERE paperback = "Yes";
什麼查詢你已經嘗試到目前爲止 –
我做我自己的家庭作業....有一個問題。基蘭.....我會發布我有什麼......謝謝。 – DDG
聽起來像你在這裏與你的功課。所以你怎麼做你自己 – Drew