Professional Documents
Culture Documents
SIXTH LAB Aims Implementation
SIXTH LAB Aims Implementation
Output
Create Table Books
Code
Output
Output
WRITE THE SQL FOR:-
1. Write a query to display the book name only of books containing less than 150 pages
Code
Output
2. Write a query to display the book name only of all books with an AuthorID of 4
Code
3. Write a query to display all books with a publication date before 2/1/2010
Code
Output
4. Write a query that will display the book name, author first name, author last name and
number of pages. Do not display any authors that do not have a book
Code
5. Write a query showing the book name and author first and last name for all books with a page
count greater than 150 pages
Code
Output
6. Create a view that will display the book name, author first name, author last name and
number of pages in the book.
Code
7. Write a SQL query that will query all data using the view defined in query6 but only display
books with a page count greater than 200 and less than 500.
Code
SELECT Book_Name,First_Name,Last_Name,PAGES
FROM book_details
WHERE PAGES BETWEEN 200 AND 500;
Output
8. Write a query to display all book titles and publication dates sorted by publication date oldest
to most recent.
Code
Output