implement the bubble sort algorithm by using the PL/SQL stored procedures.
Below is the table structure that should be used;
CREATE TABLE TBL( POSITION INTEGER,
VAL INTEGER,
CONSTRAINT PK PRIMARY KEY (POSITION)
);
INSERT INTO TBL VALUES (1, 5);
INSERT INTO TBL VALUES (2, 1);
INSERT INTO TBL VALUES (3, 4);
INSERT INTO TBL VALUES (4, 2);
INSERT INTO TBL VALUES (5, 8);
After the sorting, the results in table should be something like this.
SELET * FROM TBL
POSITION VAL
--------------- ------
1 1
2 2
3 4
4 5
5 8
Important Notes:
** The column named POSITION will always have sequential values starting from 1. There are no missing values in the sequence, so you can use the values in this column while fetching the values and comparing them.
please help me doing that
m noob in pl sql