daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```sql
  2. select publishingHouse.title, count(publishingHouse.title)
  3.     from publishingHouse JOIN book ON publishingHouse.id=book.publishingHouse_id
  4.     group by publishingHouse.title
  5.         having count(publishingHouse.title) = (select max(publishingHouse.num) as max_count
  6.             from (select publishingHouse.title, count(publishingHouse.title) as num
  7.                             from publishingHouse JOIN book ON publishingHouse.id=book.publishingHouse_id
  8.                              group by publishingHouse.id
  9.                       )
  10.                   publishingHouse
  11.               );
  12.  
  13.  
  14.  
  15.  
  16.  select publishingHouse.title
  17.     from book
  18.     JOIN author
  19.         ON book.author_id = author.id
  20.     JOIN publishingHouse
  21.         ON book.publishingHouse_id = publishingHouse.id
  22.     WHERE author.title NOT IN ('author1', 'author2')
  23.  
  24.  
  25.  
  26.  select * from book
  27.     where book.issueDate IS NULL
  28.     having book.return_date = (
  29.       select min(book.return_date) from book
  30.     )
  31. ;
  32.  
  33.  
  34.  select * from book
  35.     where book.issueDate IS NULL AND book.return_date < CAST(CURRENT_DATE AS DATE)
  36.         OR book.return_date < book.issueDate
  37. ;
  38. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top