0% found this document useful (0 votes)
3 views1 page

SQL Assignment Questions

The document contains a series of SQL assignment questions that guide the creation and manipulation of a database named 'shop'. It includes tasks such as creating tables for products and customers, inserting records, updating and deleting entries, and performing various queries to retrieve and analyze data. The assignments cover fundamental SQL operations including selection, counting, and aggregation functions.

Uploaded by

mahadevshiba7983
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

SQL Assignment Questions

The document contains a series of SQL assignment questions that guide the creation and manipulation of a database named 'shop'. It includes tasks such as creating tables for products and customers, inserting records, updating and deleting entries, and performing various queries to retrieve and analyze data. The assignments cover fundamental SQL operations including selection, counting, and aggregation functions.

Uploaded by

mahadevshiba7983
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SQL Assignment Questions

1. Write SQL to create a database named shop.

2. Create a table products with columns: id INT PRIMARY KEY AUTO_INCREMENT, name
VARCHAR(100), price DECIMAL(8,2).

3. Insert 5 sample records into products.

4. Write SQL to update the price of product with id = 2 to 450.75.

5. Delete the product with id = 3.

6. Select all products where price is greater than 200.

7. Create a table customers with fields cust_id INT AUTO_INCREMENT PRIMARY KEY,
cust_name VARCHAR(50), city VARCHAR(50).

8. Insert 3 sample customers into customers.

9. Write SQL to display only distinct city names from customers.

10. Write SQL to count total number of products in the products table.

11. Write SQL to find all books whose author name ends with 'n'.

12. Select books ordered by price in ascending order.

13. Select the top 3 most expensive books.

14. Count how many members are in the members table.

15. Write SQL to display only unique author names from books.

16. Write SQL to find the maximum price of a book.

17. Write SQL to find the minimum price of a book.

18. Write SQL to calculate the average price of books.

19. Add a new column email VARCHAR(100) to the members table.

20. Update the email of the member with member_id = 1 to ram@[Link].

You might also like