Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```sql
- select publishingHouse.title, count(publishingHouse.title)
- from publishingHouse JOIN book ON publishingHouse.id=book.publishingHouse_id
- group by publishingHouse.title
- having count(publishingHouse.title) = (select max(publishingHouse.num) as max_count
- from (select publishingHouse.title, count(publishingHouse.title) as num
- from publishingHouse JOIN book ON publishingHouse.id=book.publishingHouse_id
- group by publishingHouse.id
- )
- publishingHouse
- );
- select publishingHouse.title
- from book
- JOIN author
- ON book.author_id = author.id
- JOIN publishingHouse
- ON book.publishingHouse_id = publishingHouse.id
- WHERE author.title NOT IN ('author1', 'author2')
- select * from book
- where book.issueDate IS NULL
- having book.return_date = (
- select min(book.return_date) from book
- )
- ;
- select * from book
- where book.issueDate IS NULL AND book.return_date < CAST(CURRENT_DATE AS DATE)
- OR book.return_date < book.issueDate
- ;
- ```
Add Comment
Please, Sign In to add comment