Consider the following Student table and write the queries.
Table Student S_ID S_Name Class Sec TotalMarks S_005 Prachi Roy IX A 256 S_008 Neha Das IX A 287 S_010 Rajib Bose X B 245 S_015 Sankha Sen X D 272
(i) Write a Query to display all records (ii) Write a Query to add a new row with the following details (‘S_105’, ‘Puja Singh’, ‘X’, ‘C’, 252)
(iii) Write a query to display only Student Name and Class.
(iv) Write a query to display the Total Marks of ‘Sankha Sen’.
(v) Which attribute is/are suitable for Primary Key in the Table Student.
Answers
Answer:
Consider the following Student table and write the queries.
Table Student S_ID S_Name Class Sec TotalMarks S_005 Prachi Roy IX A 256 S_008 Neha Das IX A 287 S_010 Rajib Bose X B 245 S_015 Sankha Sen X D 272
(i) Write a Query to display all records (ii) Write a Query to add a new row with the following details (‘S_105’, ‘Puja Singh’, ‘X’, ‘C’, 252)
(iii) Write a query to display only Student Name and Class.
(iv) Write a query to display the Total Marks of ‘Sankha Sen’.
(v) Which attribute is/are suitable for Primary Key in the Table Student.
Explanation:
Consider the following Student table and write the queries.
Table Student S_ID S_Name Class Sec TotalMarks S_005 Prachi Roy IX A 256 S_008 Neha Das IX A 287 S_010 Rajib Bose X B 245 S_015 Sankha Sen X D 272
(i) Write a Query to display all records (ii) Write a Query to add a new row with the following details (‘S_105’, ‘Puja Singh’, ‘X’, ‘C’, 252)
(iii) Write a query to display only Student Name and Class.
(iv) Write a query to display the Total Marks of ‘Sankha Sen’.
(v) Which attribute is/are suitable for Primary Key in the Table Student.