Computer Science, asked by zen91, 5 months ago

Write SQL queries for (i) to (vi), which are based on the table STUDENT
i. To display the records from the table student.

ii. To display the records from table student in alphabetical order as per the name of

the student.

iii. To display the names of all Female students.

iv. To increase marks of all students by 20 whose class is “XII”.

v. Insert the following record into the Student table:

(9, “Ajay”, “X”, “14-11-1994”, “M”, “Kolkata”, 500)​

Attachments:

Answers

Answered by manavpaul27
1

Answer:

1) SELECT * FROM STUDENT;

2) SELECT * FROM STUDENT ORDER BY NAME;

3) SELECT NAME FROM STUDENT WHERE GENDER = F;

4) UPDATE STUDENT SET MARKS=MARKS+20 where class=”XII”;

5) INSERT INTO STUDENT

VALUES (9, “Ajay”, “X”, “14-11-1994”, “M”, “Kolkata”, 500);

Hope it helps!

All the best!

Answered by Equestriadash
11

i. To display the records from the table 'student'.

  • Select * from Student;

ii. To display the records from table 'student' in alphabetical order as per the name of the student.

I'm not able to see the column name in the table that's supposed to represent the names of the students, so I'm naming it as 'Name'.

  • Select * from Student order by Name;

iii. To display the names of all Female students.

  • Select Name from Student where Gender = 'F';

iv. To increase marks of all students by 20 of whose class is “XII”.

I'm not able to see the column name in the table that's supposed to represent the classes of the students, so I'm naming it as 'Class'.

  • Select Marks + 20 as 'New Marks' from Student where Class = 'XII';

v) Insert the following record into the Student table: (9, “Ajay”, “X”, “14-11-1994”, “M”, “Kolkata”, 500)​

  • Insert into Student values(9, 'Ajay', 'X', '1994-11-14', 'M', 'Kolkata', 500);

Anonymous: Perfection at peak!
Equestriadash: Thank you! ^_^"
Anonymous: Welcome ❤️
Similar questions