Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Integer-comparison/SQL-PL/integer-comparison-1.sql
Normal file
15
Task/Integer-comparison/SQL-PL/integer-comparison-1.sql
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
CREATE TABLE TEST (
|
||||
VAL1 INT,
|
||||
VAL2 INT
|
||||
);
|
||||
INSERT INTO TEST (VAL1, VAL2) VALUES
|
||||
(1, 2),
|
||||
(2, 2),
|
||||
(2, 1);
|
||||
SELECT
|
||||
CASE
|
||||
WHEN VAL1 < VAL2 THEN VAL1 || ' less than ' || VAL2
|
||||
WHEN VAL1 = VAL2 THEN VAL1 || ' equal to ' || VAL2
|
||||
WHEN VAL1 > VAL2 THEN VAL1 || ' greater than ' || VAL2
|
||||
END COMPARISON
|
||||
FROM TEST;
|
||||
17
Task/Integer-comparison/SQL-PL/integer-comparison-2.sql
Normal file
17
Task/Integer-comparison/SQL-PL/integer-comparison-2.sql
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
--#SET TERMINATOR @
|
||||
|
||||
SET serveroutput ON @
|
||||
|
||||
CREATE PROCEDURE COMPARISON (IN VAL1 INT, IN VAL2 INT)
|
||||
BEGIN
|
||||
IF (VAL1 < VAL2) THEN
|
||||
CALL DBMS_OUTPUT.PUT_LINE(VAL1 || ' less than ' || VAL2);
|
||||
ELSEIF (VAL1 = VAL2) THEN
|
||||
CALL DBMS_OUTPUT.PUT_LINE(VAL1 || ' equal to ' || VAL2);
|
||||
ELSEIF (VAL1 > VAL2) THEN
|
||||
CALL DBMS_OUTPUT.PUT_LINE(VAL1 || ' greater than ' || VAL2);
|
||||
END IF;
|
||||
END @
|
||||
CALL COMPARISON(1, 2) @
|
||||
CALL COMPARISON(2, 2) @
|
||||
CALL COMPARISON(2, 1) @
|
||||
Loading…
Add table
Add a link
Reference in a new issue