Advertisement
hgr24

Untitled

Mar 30th, 2022
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.85 KB | None | 0 0
  1.  SELECT S.*, SS.SEM, SS.SEC
  2.  FROM STUDENT S, SEMSEC SS, CLASS C
  3.  WHERE S.USN = C.USN AND
  4.  SS.SSID = C.SSID AND
  5.  SS.SEM = 4 AND
  6.  SS.SEC='C';
  7.  
  8.  
  9. SELECT SS.SEM, SS.SEC, S.GENDER, COUNT (S.GENDER) AS COUNT
  10. FROM STUDENT S, SEMSEC SS, CLASS C
  11. WHERE S.USN = C.USN AND
  12. SS.SSID = C.SSID
  13. GROUP BY SS.SEM, SS.SEC, S.GENDER
  14. ORDER BY SEM;
  15.  
  16.  
  17. CREATE VIEW STU_TEST1_MARKS_VIEW
  18.  AS
  19.  SELECT TEST1, SUBCODE
  20.  FROM IAMARKS
  21.  WHERE USN = '1BI15CS101';
  22.  
  23.  
  24. UPDATE IAMARKS SET FINALIA=((TEST1+TEST2+TEST3)-
  25. LEAST(TEST1,TEST2,TEST3))/2;
  26.  
  27.  
  28. SELECT S.USN,S.SNAME,S.ADDRESS,S.PHONE,S.GENDER,IA.SUBCODE,
  29.  (CASE
  30.  WHEN IA.FINALIA BETWEEN 17 AND 20 THEN 'OUTSTANDING'
  31.  WHEN IA.FINALIA BETWEEN 12 AND 16 THEN 'AVERAGE'
  32.  ELSE 'WEAK'
  33.  END) AS CAT
  34.  FROM STUDENT S, SEMSEC SS, IAMARKS IA, SUBJECT SUB
  35.  WHERE S.USN = IA.USN AND
  36.  SS.SSID = IA.SSID AND
  37.  SUB.SUBCODE = IA.SUBCODE AND
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement