Answer :
Here's how you can write SQL queries for the given tasks based on the COURSE table described:
(a) Update the Strength to 180 for CourseID C001:
To update the STRENGTH of the course with CourseID C001, you can use the UPDATE statement in SQL. This changes the STRENGTH column for the specified course:
UPDATE COURSESET STRENGTH = 180
WHERE COURSEID = 'C001';
- UPDATE COURSE: This specifies that you're updating the COURSE table.
- SET STRENGTH = 180: This sets the STRENGTH column to 180.
- WHERE COURSEID = 'C001': This ensures only the course with CourseID C001 is updated.
(b) Display the details of MBA Course:
To display details of the MBA course, you'll use the SELECT statement along with the WHERE clause to filter the results:
SELECT *FROM COURSE
WHERE COURSE_NAME = 'MBA';
- **SELECT ***: This selects all columns in the COURSE table.
- FROM COURSE: This specifies the table you are selecting data from.
- WHERE COURSE_NAME = 'MBA': This filters the results to only include rows where the COURSE_NAME is MBA.
By executing these queries, you will successfully update the STRENGTH of the specified course and retrieve all details of the MBA course from the COURSE table.