3 ms·
CREATE TABLE even_or_odd ( is_odd NUMBER(1); is_even NUMBER(1); is_zero NUMBER(1); is_one NUMBER(1); is_two NUMBER(1); is_th
by whoopdedo 3y ago
CREATE TABLE even_or_odd (
is_odd NUMBER(1);
is_even NUMBER(1);
is_zero NUMBER(1);
is_one NUMBER(1);
is_two NUMBER(1);
is_three NUMBER(1);
-- ...
);
INSERT INTO even_or_odd (is_odd,is_one) VALUES (1,1);
INSERT INTO even_or_odd (is_even,is_two) VALUES (1,1);
- ht85 3y agoA better design would look like this: CREATE TABLE numbers ( minus_four_billions_two_hundred_ninety_four_millions_nine_hundred_sixty_seven_thousands_two_hundred_ninety_six_is_even BOOLEAN, ... zero_is_even BOOLEAN, one_is_even BOOLEAN, two_is_even BOOLEAN, ... four_billions_two_hundred_ninety_four_millions_nine_hundred_sixty_seven_thousands_two_hundred_ninety_six_is_even BOOLEAN ) That design can store multiple versions of the data, making it more resilient to future changes in the even/odd property of numbers.