Example HTML page

MySQL Assignment 4

Hi,

The following questions are based on Select Statement and Where clause. These are the questions at basic level, in the next assignments you may get some more complicated questions to retrieve the data from the database.

1. Create a Table Student with Four attributes ‘regno’, ‘name’,’year’ and ‘percentage’.

The type of each attribute is ‘int’,’varchar’,’varchar’,’float’ respectively

2.Insert the following data in to the table

+-------+----------+--------+------------+
| regno | name     | year   | percentage |
+-------+----------+--------+------------+
|  1001 | sudhakar | first  |         65 |
|  1002 | rajesh   | second |         75 |
|  1002 | sowmya   | third  |         85 |
|  1003 | binish   | fourth |         90 |
|  1004 | mohan    | first  |         78 |
|  1005 | rohit    | first  |         96 |
|  1006 | rathnam  | fourth |         65 |
|  1006 | rathnam  | fourth |         65 |
+-------+----------+--------+------------+

3.Write a query to print the name and year of all the students.

4.Write a query to print all the columns present in the student table.

5.Write a query to print the name of the student who got ’75’ marks.

6.Write a query to print the name of the student who have the same percentage.

7.Write a query to print the unique rows in a table.

8.Write a query to print the duplicated rows.

9.Write a query to print the names of the students who are in ‘first’ year.

10.Write a query to print the ‘year’ of the student ‘rohit’ is studying.

11.Write a query to print the ‘name’ and ‘year’ of the student whose register number is 1003.

12.Write a query to print the student details who is having maximum percentage.

13.Write a query to print the ‘mohan’ percentage.

14.Write a query to print the students registration numbers who are having more than 80 percentage in ‘first’ year.

15.Write a query to print the ‘fourth’ year student details in the following order.

name,register number, percentage.

16. Write a query to print the student names whose marks are not equal to ’65’.

17. Write a query to print all the student names in sorted order.

18. Write a query to print the name and percentage of the students. The details should be sorted based on low percentage to high percentage.

19. Write a query to print the name and percentage of the students. The details should be sorted based on high percentage to low percentage.

20. Write a query to print the student details from fourth year to first year order.

Example HTML page

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest