with positions as ( select level id from dual connect by level <= 5),
     permutations as ( select p1.id a, p2.id b, p3.id c, p4.id d, p5.id e
                       from positions p1, positions p2, positions p3, positions p4, positions p5
                       where p1.id <> p2.id and p1.id <> p3.id and p1.id <> p4.id and p1.id <> p5.id and
                                                p2.id <> p3.id and p2.id <> p4.id and p2.id <> p5.id and
                                                                   p3.id <> p4.id and p3.id <> p5.id and
                                                                                      p4.id <> p5.id),
     Names  as ( select a Winslow, b Marcolla, c Contee, d Natsiou, e Finch from permutations),
     Colors as ( select a red, b white, c purple, d blue, e green from permutations),
     Cities as ( select a Bailton, b Serkonos, c Freiport, d Morley, e Danuol from permutations),
     Drinks as ( select a absent, b coctail, c rum, d cider, e whiskey from permutations),
     Items  as ( select a ring, b diamond, c medal, d cigarcase, e coulomb from permutations),
     solution as ( select *
                   from Names, Colors, Cities, Drinks, Items
                   where Winslow = blue and Marcolla = 1 and abs(Marcolla - white) = 1 and
                         red + 1 = purple and red = whiskey and Morley = green and
                         abs(cigarcase - Morley) = 1 and Finch = coulomb and Freiport = ring and
                         abs(diamond - Danuol) = 1 and abs(Danuol - coctail) = 1 and Contee = absent and
                         Serkonos = cider and rum = 3 and Natsiou = Bailton)
select id as position,
       case id
            when Winslow then 'Winslow'
            when Marcolla then 'Marcolla'
            when Contee then 'Contee'
            when Natsiou then 'Natsiou'
            when Finch then 'Finch'
          end as Name,
       case id
            when red then 'red'
            when white then 'white'
            when purple then 'purple'
            when blue then 'blue'
            when green then 'green'
          end as Color,
       case id
            when Bailton then 'Bailton'
            when Serkonos then 'Serkonos'
            when Freiport then 'Freiport'
            when Morley then 'Morley'
            when Danuol then 'Danuol'
          end as City,
       case id
            when absent then 'absent'
            when coctail then 'coctail'
            when rum then 'rum'
            when cider then 'cider'
            when whiskey then 'whiskey'
          end as Drink,
       case id
            when ring then 'ring'
            when diamond then 'diamond'
            when medal then 'medal'
            when cigarcase then 'cigarcase'
            when coulomb then 'coulomb'
          end as Item
from positions, solution
order by id; 

Oracle Online Compiler

Write, Run & Share Oracle queries online using OneCompiler's Oracle online editor and compiler for free. It's one of the robust, feature-rich online editor and compiler for Oracle running on latest version 23c (23.3.0.0). Getting started with the OneCompiler's Oracle editor is really simple and pretty fast. The editor shows sample boilerplate code when you choose language as 'Oracle' and start writing queries to learn and test online without worrying about tedious process of installation.

About Oracle

Oracle Database is world's most popular database built by Oracle Corporation. It is a multi-model database management system. It's known for its robustness, scalability, and comprehensive feature set, making it popular for enterprise-level applications and large-scale data management.

Syntax help

Commands

1. CREATE

CREATE TABLE table_name (
                column1 datatype,
                column2 datatype,
                ....);

Example

CREATE TABLE EMPLOYEE (
  empId NUMBER PRIMARY KEY,
  name VARCHAR2(15) NOT NULL,
  dept VARCHAR2(10) NOT NULL
);

2. Add Data

Example

INSERT INTO EMPLOYEE VALUES (1, 'Dave', 'Sales');

3. TRUNCATE

TRUNCATE table table_name;

4. DROP

DROP TABLE table_name;

6. COMMENTS

Single-Line Comments:

 --Line1;

Multi-Line comments:

   /* Line1,
   Line2 */

DML Commands

1. INSERT

INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);

Note: Column names are optional.

Example

INSERT INTO EMPLOYEE VALUES (1, 'Ava', 'Sales');

2. SELECT

SELECT column1, column2, ...
FROM table_name
[where condition]; 

Example

SELECT * FROM EMPLOYEE where dept ='sales';

3. UPDATE

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition; 

Example

UPDATE EMPLOYEE SET dept = 'Sales' WHERE empId='0001'; 

4. DELETE

DELETE FROM table_name where condition;

Example

DELETE from EMPLOYEE where empId='0001';