Xii Ip SQL
Xii Ip SQL
20 )
NOTE : You can use your own table name inside your database.
20. Create a student1 table with the Student_id, Name, Gender and
Marks as attributes where the Student_id is the primary key.
SQL CODE
SQL CODE
mysql> insert into student1(student_id,name,gender,marks)
-> values(2001,'kamal','boy',45),
-> (2002,'ravi','boy',25),
-> (2003,'nandini','girl',43),
-> (2004, 'Prasant', 'Boy', 28),
-> (2006,'Ruchi','Girl',29),
-> (2009,'Ketaki','Girl', 12);
-> (2010, 'Rahul', 'Boy', 28),
-> (2011,'Ketan','Boy',21),
-> (2014, 'Sajal', 'Boy',46),
-> (2016,'Rajni','Boy', 40);
Query OK, 10 rows affected (0.02 sec)
Records: 10 Duplicates: 0 Warnings: 0
22. Use the select command to get the details of the students with
marks more than 40.
SQL CODE
23. Show the students record of all Girls students along with their
name.
SQL CODE
24. Find the min, max, sum, and average of the marks field in
student1 table.
SQL CODE
25. Show all the Students whose name started with K. (Example
Ketaki, Ketan etc)
SQL CODE
26. Show all Students whose name ended with i. (Example Ketaki
etc)
SQL CODE
27. Find the total number of records in the table student1.
SQL CODE
29. Add one more column ‘Section’ char(1) in the table Student1.
SQL CODE
34. Delete the student whose Student who secured marks less
than 22.
SQL CODE
………………………………………………………………………………………….
******