SQLite中的SQL EXIST语句

LibraryDB是一个数据库系统,可在假想的图书馆中跟踪有关书籍及其流通的信息。

下面给出了LibraryDB数据库的模式:

- borrow(transactionID, personID*, borrowdate, duedate, returndate) 
- author(authorID, firstname, middlename, lastname)
- book_copy(bookID, bookdescID*)
- book(bookdescID, title, subtitle, edition, voltitle, volnumber, language, place, year, isbn, dewey, subjectID*)
- borrow_copy(transactionID*, bookID*)
- person(personID, firstname, middlename, lastname, address, city, postcode, phonenumber, emailaddress, studentno, idcardno)
- publisher(publisherID, publisherfullname) 
- written_by(bookdescID*, authorID*, role) 
- published_by(bookdescID*, publisherID*, role) 
- subject(subjectID, subjecttype)

带下划线的主键。外键用星号(*)表示。

为以下任务编写SQL查询:

显示作者阿尔弗雷德·阿霍(Alfred Aho)与他的书一起出版的出版商的全名。您的查询必须使用EXISTS子句。

评论