MySQL Practice Questions
1. Create a table named 'Books' with columns: BookID (INT, Primary Key), Title (VARCHAR), Author
(VARCHAR), Price (FLOAT).
2. Insert 3 records into the 'Books' table with your own data.
3. Write a query to display all records from the 'Books' table.
4. Write a query to update the price of a book where BookID is 101.
5. Delete a record from the 'Books' table where BookID is 102.
6. Add a new column 'Publisher' (VARCHAR) to the 'Books' table.
7. Drop the 'Publisher' column from the 'Books' table.
8. Write a query to display books priced above 300.
9. Write a query to display books by a specific author (e.g., 'J.K. Rowling').
10. Display all books sorted by price in descending order.
11. Write a query to display titles starting with 'T'.
12. Display all books that have 'Science' in their title.
13. Write a query to display books with price between 200 and 500.
14. Find the total number of books in the table.
15. Calculate the average price of books.
16. Find the maximum and minimum book price.
17. Count the number of books written by each author.
18. Find the total price of books by each author.
19. Display authors having more than 1 book in the table.
20. Write a query to group books by author and show the average price per author.