0% found this document useful (0 votes)
11 views8 pages

Naveen MySQL

The document outlines a series of database operations to be performed on a database named 'kv2', including creating a table for students, inserting data, displaying various details, and performing queries based on specific criteria. It also includes instructions for modifying the database structure and ultimately removing the database. The tasks cover a wide range of SQL operations such as selection, aggregation, and data manipulation.

Uploaded by

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

Naveen MySQL

The document outlines a series of database operations to be performed on a database named 'kv2', including creating a table for students, inserting data, displaying various details, and performing queries based on specific criteria. It also includes instructions for modifying the database structure and ultimately removing the database. The tasks cover a wide range of SQL operations such as selection, aggregation, and data manipulation.

Uploaded by

fffearless74
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1.Create database name ‘kv2’.

2.Open the database ‘kv2’.

3. Create the following table: Student

4. Add the following rows in the table student.

5. Display all the tables.

6.Display the details of all students.

Page 22 of 29
7.Give the structure of the table student.

8.Display the name and marks of all students.

9. Display the details of all students whose name contains second letter as ‘a’.

10.Display the details of all students in descending order of their names.

11.Display the name of those students whose city is not found.

Page 23 of 29
12. Display the name and city of those students who belongs to Chennai or
Delhi.

13. Display the name of those students whose age is 17 and belongs to Delhi.

14. Display the details of all students whose marks is in the range of 400 to 450.

15.Display the details of all students whose marks is not in the range of 400 to 450.

16. Display the name of those students who belongs to Delhi, Chennai or Kolkata.

17. Display the details of all students whose name contains second last letter as ‘a’.

Page 24 of 29
18.Display the names of all students whose name contains 5 letters.

19. Display the names of all students whose name contains last letter as ‘a’.

20. Display the names of different cities.

21. Display the details of all students in ascending order of city and then in
descending order of names.

22. To find min, max, sum and average of marks of students.

Page 25 of 29
23. To find difference between max and min and display it as ‘Difference’.

24.To find total number of records.

25. Find number of students from Delhi.

26. Find number of cities in the table student .

27. Find number of different cities in the table student.

28. Count number of students in each city.

Page 26 of 29
29. Find average marks of each city.

30. Find max and min marks of each age group.

31. Find number of students in each city which has min 2 students.

32. Create the table ‘Details’ and write queries to insert records.

33. Display roll no, name, mother name and father name from table student and details.

Page 27 of 29
34. Display name and email of those students who secured more than 400, using tables
student and details.

35. Display name, age and address of students whose age is 17.

36. Find the cartesian product of both the tables.

37. Find natural join of both the tables.

38. Change the mark of Ramya as 390.

39. Give extra 10 marks to all students.

Page 28 of 29
40.Remove the details of those students who resides in ‘Chennai’.

41.Add a column named email id of type varchar and size 50.

42.Increase the size of city column as 20.

43.Remove the column email id.

44. Remove the table student.

45. Remove the database kv2.

Page 29 of 29

You might also like