Database Management System
Database Management System
SYSTEM
ACTIVITY BASED ASSESSMENT
PRESENTED BY :
1. AMRUTHASINDHU A 4VV20CS009
2. CHAITHANYA S 4VV20CS021
3. CHINMAYI H 4VV20CS024
1. List all the student details studying in fourth semester ‘C’ section.
section.
subjects.
4. Calculate the FinalIA (average of best two test marks) and update the
Give these details only for 8th semester A, B, and C section students.
Table Creation
8877881122,’M’);
7722829912,’F’);
7712312312,’F’);
8877881122,’F’);
9900211201,’M’);
9923211099,’M’);
7696772121,’F’);
8812332201,’M’);
9900232201,’M’);
9905542212,’F’);
8800880011,’M’);
INSERT INTO IAMARKS (USN, SUBCODE, SSID, TEST1, TEST2, TEST3) VALUES
INSERT INTO IAMARKS (USN, SUBCODE, SSID, TEST1, TEST2, TEST3) VALUES
INSERT INTO IAMARKS (USN, SUBCODE, SSID, TEST1, TEST2, TEST3) VALUES
INSERT INTO IAMARKS (USN, SUBCODE, SSID, TEST1, TEST2, TEST3) VALUES
INSERT INTO IAMARKS (USN, SUBCODE, SSID, TEST1, TEST2, TEST3) VALUES
1. List all the student details studying in fourth semester ‘C’ section.
SS.SEM = 4 AND
SS.SEc=’C’;
2. Compute the total number of male and female students in each semester and in
each
section.
SS.SSID = C.SSID
ORDER BY SEM;
3. Create a view of Test1 marks of student USN ‘1BI15CS101’ in all subjects.
AS
FROM IAMARKS
4. Calculate the FinalIA (average of best two test marks) and update the
corresponding
IS
CURSOR C_IAMARKS IS
FROM IAMARKS
FOR UPDATE;
C_A NUMBER;
C_B NUMBER;
C_C NUMBER;
C_SM NUMBER;
C_AV NUMBER;
BEGIN
OPEN C_IAMARKS;
LOOP
C_SM:=C_A+C_B;
ELSE
C_SM:=C_A+C_C;
END IF;
C_AV:=C_SM/2;
--DBMS_OUTPUT.PUT_LINE(‘SUM = ‘||C_SM);
--DBMS_OUTPUT.PUT_LINE(‘AVERAGE = ‘||C_AV);
END LOOP;
CLOSE C_IAMARKS;
END;
Below SQL code is to invoke the PL/SQL stored procedure from the command line:
BEGIN
AVGMARKS;
END;
Give these details only for 8th semester A, B, and C section students.
SELECT S.USN,S.SNAME,S.ADDRESS,S.PHONE,S.GENDER,
(CASE
ELSE ‘WEAK’
END) AS CAT
SUB.SEM = 8;