Advertisement
solidsnake

March 4 Activity

Mar 3rd, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.48 KB | None | 0 0
  1. 2. SELECT book_id, title, author_name, author_address, author_contract, price, advance, royalty, notes, pubdate, pub_id FROM book WHERE title LIKE '%u%';
  2.  
  3. 3. SELECT author_name FROM book WHERE price<600;
  4.  
  5. 4. SELECT title, price FROM book WHERE price<500 AND price>50;
  6.  
  7. 5. INSERT INTO publisher(name, city, state, country) VALUES ('MacLehose Press', '','','United Kingdom');
  8.  
  9. 6. INSERT INTO book (title, author_name, author_address, price, advance, royalty, pubdate, pub_id) VALUES ('The Girl with the Dragon Tattoo', 'Steig Larsson', 'Sweden', 545.00, 150000, 0.15, '20080110', 3);
  10.  
  11. 7. SELECT book_id, title FROM book WHERE price<601;
  12.  
  13. 8. SELECT book_id, title, author_name, author_address, author_contract, price, advance, royalty, notes, pubdate, pub_id FROM book WHERE title LIKE '%A Song of Ice and Fire%' OR title LIKE '%Lord of the Rings%';
  14.  
  15. 9. SELECT DISTINCT author_name FROM book WHERE title LIKE '%Lord of the Rings%' OR title LIKE '%A Song of Ice and Fire%';
  16.  
  17. 10. SELECT book.title 'Title of Book', book.author_name 'Name of Author', publisher.name 'Name of Publisher' FROM book, publisher WHERE book.pub_id = publisher.pub_id ORDER BY publisher.name;
  18.  
  19. 11. SELECT title FROM book ORDER BY title DESC;
  20.  
  21. 12. SELECT DISTINCT author_name 'Author has Name with T' FROM book WHERE author_name LIKE '%T%' OR author_name LIKE '%t%';
  22.  
  23. 13. SELECT book.title, publisher.name FROM book, publisher WHERE book.pub_id = publisher.pub_id AND (author_name LIKE '%T%' OR author_name LIKE '%t%');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement