--SELECT column_name(s) --FROM table_name --[WHERE condition] --[GROUP BY column_name(s)] --[HAVING condition] --[ORDER BY column_name(s)]; --concatenation --desc, asc, nulls last, nulls first --conditions in WHERE clause: -- <, >, =, <>, != -- between X and y -- in, not in -- is null, is not null -- LIKE _ - one character, % - zero or more character -- AND -- OR --Functions: -- round() -- trunc() -- substr() -- instr() -- length() -- to_char() -- to_date() -- month_between() -- extract(... from ...) -- lower() -- upper() -- replace() -- nvl() -- max() -- min() -- count() -- avg() -- sum() -- sysdate - current system date and time -- subquery ! -- The different set operators are: -- UNION -- UNION ALL -- MINUS -- INTERSECT -- ROWNUM -- INNER JOIN -- LEFT OUTER JOIN -- RIGHT OUTER JOIN -- FULL OUTER JOIN -- FETCH FIRST n ROWS ONLY -- FETCH FIRST n ROWS WITH TIES -- OFFSET n ROWS FETCH NEXT m ROWS WITH TIES -- DISTINCT ---------------------------------------------------------------------------- --1. List the title of the books which author is Erich Gamma --2. Which books (title) were borrowed more than 2 times? --3. Who is the oldest customer? --4. Select the book items which theoretical value is less than the -- price of the related book. --5. Select the last borrowing. --6. Number of books that were published between 1990 and 2000, or -- whose price is between 1000 and 3000, or -- whose topic is 'Science Fiction' and are shorter than 20 pages --7. List only those years when more than one customer was born --8. Select full name of student customers having currently some books -- borrowed (i.e., bring-back date is unknown), together with the titles -- of the borrowed books and the book -- item IDs --9. List the books which got more than 2000 royalty for the writing, -- or which has more than two book_items. --10. In the thriller topic which book has the lowest price? --11. What is the sum of theoretical value of the book items for each -- book id? --12. List the topics which have less then 6 books. --13. List the categories of the customers where the average membership fee is less than 3000. --14. Create a view which lists for each books (id, title) -- how many times was it borrowed. --15. How many book items was borrowed by each customer (name)? --16. List the books which title contains exactly two 'c' --17. List the books which price is between 2000 and 5000. --18. What are title of the books which price is less than -- the average price of the books which topic is Thriller, -- or History? --19. How many books belongs to each publisher? --20. List the second 5 book items which has largest theoretical value