Question 1
A sequence is a database/schema object used to generate a unique auto-number. The auto-number generated through a sequence is independent of tables, which means that the same number can be used for multiple tables.
Consider the following table:
Assignment_No Course_Code Total_Marks
1 CS201 15
2 CS614 20
1 CS614 10
5 CS610 25
3 CS409 15
You are required to write a PL/SQL PROCEDURE named Add that insert a new record in the above table
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add`(IN `assignNo` INT, IN `course_code` VARCHAR(20), IN `mark` INT)
BEGIN
INSERT INTO `student`(`Assignment_No`, `Course_Code`, `Total_Marks`) VALUES (assignNo,course_code, mark);
END
Comments
Leave a comment