Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
16.4k views
in Information Technology by (71.2k points)

Rishi, a class XII student has given following commands for the given purposes: 

(i) To add a new column “Rating” : update table library add column rating varchar(20); 

(ii) To give an increase of 50 Rs. to all the books: 

alter library set price=price+50; 

Check if above given SQL commands will be able to achieve desired task or not. Justify your answer. Suggest the correction (s) if required.

1 Answer

+1 vote
by (76.3k points)
selected by
 
Best answer

No, above commands will not be able to achieve desired task as update and alter commands have been interchanged.

In order to achieve desired result, following corrections should be incorporated in the previously used commands:

(i) To add a new column “Rating”: 

Alter table library add column rating varchar(20); 

(ii) To give an increase of 50 Rs. to all the books: 

Update library set price=price+50;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...