CREATE TABLE t_b8TmXJYj7 (c_NiVEveUN3c NUMERIC DEFAULT -960991, c_mfOVVp6LJ INTEGER, c_aegv NUMERIC, UNIQUE (c_aegv));
CREATE TABLE IF NOT EXISTS t_KVR (c_4fLRz NUMERIC, c_pLcd NUMERIC, c_0g82YslPQP TEXT, c_ZrDP INTEGER, UNIQUE (c_0g82YslPQP, c_ZrDP, c_pLcd));
CREATE TABLE IF NOT EXISTS t_EiJ (c_SdSqONhoo REAL, c_kRp REAL, c_xy5FvRM NUMERIC, c_gjO9hafpB TEXT COLLATE NOCASE, c_KijMRW5dz NUMERIC, c_5t6reT NUMERIC, c_KZCXb INTEGER, c_Le8nWz INTEGER DEFAULT -375053, c_6C2xHrvsC NUMERIC);
CREATE TABLE IF NOT EXISTS t_ugYfNyM (c_Ds2ESO7 REAL, c_5P7M TEXT, c_8JJK18gYW NUMERIC, c_1QTB REAL, c_VzurM REAL, c_LSLrg TEXT DEFAULT 'jpRoKBjn8I3Xt3K8F', c_U5SL REAL DEFAULT -172708.433646);
WITH cte_1VE AS (SELECT 1) REPLACE INTO t_b8TmXJYj7 (c_NiVEveUN3c, c_mfOVVp6LJ, c_aegv) VALUES (68618957, 68124592, 69596440);
INSERT OR IGNORE INTO t_b8TmXJYj7 (c_NiVEveUN3c, c_mfOVVp6LJ, c_aegv) VALUES (68255927, 69328195, 69129694), (167182449, 168788063, 169269878);
INSERT OR IGNORE INTO t_b8TmXJYj7 (c_NiVEveUN3c, c_mfOVVp6LJ, c_aegv) SELECT 67849131, 68161280, 68664380;
REPLACE INTO t_b8TmXJYj7 (c_NiVEveUN3c, c_mfOVVp6LJ, c_aegv) VALUES (66825107, 69562452, 69483783);
REPLACE INTO t_b8TmXJYj7 (c_NiVEveUN3c, c_mfOVVp6LJ, c_aegv) SELECT 68023262, 67898560, 70447041;
REPLACE INTO t_KVR (c_4fLRz, c_pLcd, c_0g82YslPQP, c_ZrDP) VALUES (67586788, 69007682, 'S5siRweQlWl_6962', 71249119), (167301749, 169075594, '2_16962', 170225481);
INSERT OR IGNORE INTO t_KVR (c_4fLRz, c_pLcd, c_0g82YslPQP, c_ZrDP) VALUES (66661430, 68148925, 'KbS_6962', 71050733), (166965804, 169096064, '5zUuW4TZF_16962', 170277881);
INSERT OR REPLACE INTO t_KVR (c_4fLRz, c_pLcd, c_0g82YslPQP, c_ZrDP) VALUES (67237374, 68315466, 'UOmHdDILWshcgJX8_6962', 70048725), (167018197, 168224093, 'ZsYHf9pHOvGcYmGHJvX_16962', 170517915);
INSERT OR IGNORE INTO t_EiJ (c_SdSqONhoo, c_kRp, c_xy5FvRM, c_gjO9hafpB, c_KijMRW5dz, c_5t6reT, c_KZCXb, c_Le8nWz, c_6C2xHrvsC) SELECT -857142.38, -621000.925424, 69459049, 'wnb_7062', 71842715, 73589245, 72723476, 75427091, 76130032;
INSERT OR IGNORE INTO t_EiJ (c_SdSqONhoo, c_kRp, c_xy5FvRM, c_gjO9hafpB, c_KijMRW5dz, c_5t6reT, c_KZCXb, c_Le8nWz, c_6C2xHrvsC) VALUES (-718855.102834, -629577.27261, 69368544, 'ZFjQt092_7062', 72490891, 71918416, 74314877, 74543671, 74652023);
REPLACE INTO t_EiJ (c_SdSqONhoo, c_kRp, c_xy5FvRM, c_gjO9hafpB, c_KijMRW5dz, c_5t6reT, c_KZCXb, c_Le8nWz, c_6C2xHrvsC) VALUES (414704.108, 1048309.819191, 70128793, 'zOWaZFEHdu5iuu8iMtOz_7062', 72196568, 72447823, 72636705, 74091971, 75205132);
INSERT OR REPLACE INTO t_EiJ (c_SdSqONhoo, c_kRp, c_xy5FvRM, c_gjO9hafpB, c_KijMRW5dz, c_5t6reT, c_KZCXb, c_Le8nWz, c_6C2xHrvsC) VALUES (-233902.57799999998, 802407.790856, 69815596, 'Gyf9GEFb_7062', 70691413, 72149888, 73938813, 73853273, 75565585);
INSERT OR IGNORE INTO t_ugYfNyM (c_Ds2ESO7, c_5P7M, c_8JJK18gYW, c_1QTB, c_VzurM, c_LSLrg, c_U5SL) VALUES (894582.9, '0CFv2w7_6862', 69742082, 674813.151, 149442.5868, 'jrkJ3GV_7262', -124341.34737);
INSERT OR REPLACE INTO t_ugYfNyM (c_Ds2ESO7, c_5P7M, c_8JJK18gYW, c_1QTB, c_VzurM, c_LSLrg, c_U5SL) VALUES (61210.87521, 'EGP1rmQYUpfA5PcbDv_6862', 70399197, -78775.70000000001, 595983.0329, 'CCEez94ZL_7262', -816692.217);
REPLACE INTO t_ugYfNyM (c_Ds2ESO7, c_5P7M, c_8JJK18gYW, c_1QTB, c_VzurM, c_LSLrg, c_U5SL) VALUES (-382077.654528, 'gq6kjR6hk2MinDGvH_6862', 69296552, 365218.492, -24007.558999999994, 'Tih8brcruZia_7262', -833242.13603);
INSERT OR REPLACE INTO t_ugYfNyM (c_Ds2ESO7, c_5P7M, c_8JJK18gYW, c_1QTB, c_VzurM, c_LSLrg, c_U5SL) VALUES (966021.95, 'mrPsrzQV_6862', 69590525, 506705.4, -35548.860799999995, 'DQ7boZrXDVj1_7262', -625044.6162), (-546464.664107, 'CZRl2eRS_16862', 170037747, -674957.511, -78493.81719999999, 'F8RFW_17262', 1166186.3900000001);
INSERT OR REPLACE INTO t_ugYfNyM (c_Ds2ESO7, c_5P7M, c_8JJK18gYW, c_1QTB, c_VzurM, c_LSLrg, c_U5SL) VALUES (600499.1, 'i9YFYa1L7Om_6862', 70405599, 34903.9966, 351863.4218, 'rvK33fCZBTkD8JibN_7262', -612390.8);
INSERT INTO t_EiJ DEFAULT VALUES;

SELECT * FROM (
SELECT * FROM (SELECT 1 AS col_c) 
WHERE col_c IN (
    SELECT (PERCENT_RANK() OVER()) FROM (VALUES (NULL))
)
);
SELECT t_EiJ.c_KijMRW5dz, t_EiJ.c_KZCXb, t_EiJ.c_kRp FROM t_EiJ ORDER BY t_EiJ.c_KijMRW5dz DESC LIMIT 10;
SELECT *, CASE c_mfOVVp6LJ WHEN t_b8TmXJYj7.c_NiVEveUN3c THEN FALSE WHEN ROUND(t_b8TmXJYj7.c_mfOVVp6LJ, t_b8TmXJYj7.c_aegv) THEN (338681 IS NOT FALSE) ELSE - t_b8TmXJYj7.c_NiVEveUN3c END, *, t_b8TmXJYj7.c_aegv, * FROM t_b8TmXJYj7 ORDER BY 1;
SELECT t_b8TmXJYj7.c_mfOVVp6LJ AS alias_8yO, NOT COUNT(t_EiJ.c_gjO9hafpB) AS alias_hhH, * FROM t_EiJ, t_KVR, t_b8TmXJYj7 WHERE c_mfOVVp6LJ GROUP BY c_4fLRz, c_pLcd, c_0g82YslPQP HAVING FALSE ORDER BY 1;

SELECT DISTINCT t_EiJ.c_6C2xHrvsC,
    COUNT(*) OVER (PARTITION BY t_EiJ.c_Le8nWz) as window_count,
    RANK() OVER (ORDER BY CASE WHEN typeof(t_EiJ.c_6C2xHrvsC) IN ('null') THEN 0 
                            ELSE t_EiJ.c_6C2xHrvsC END DESC) as rank_val,
    CASE WHEN t_EiJ.c_6C2xHrvsC IS NULL THEN 'Unknown' ELSE 'Known' END as status
FROM t_EiJ
WHERE t_EiJ.c_6C2xHrvsC IS NOT NULL
GROUP BY t_EiJ.c_6C2xHrvsC, t_EiJ.c_Le8nWz
HAVING COUNT(*) > 0
ORDER BY window_count DESC
LIMIT 20;


SELECT t_EiJ.c_6C2xHrvsC,
    t_EiJ.c_Le8nWz,
    SUM(CASE WHEN typeof(t_EiJ.c_6C2xHrvsC) IN ('integer', 'real', 'numeric') THEN t_EiJ.c_6C2xHrvsC ELSE 0 END) 
        OVER (PARTITION BY t_EiJ.c_Le8nWz) as window_total
FROM t_EiJ
GROUP BY t_EiJ.c_6C2xHrvsC, t_EiJ.c_Le8nWz
HAVING SUM(CASE WHEN typeof(t_EiJ.c_6C2xHrvsC) IN ('integer', 'real', 'numeric') THEN t_EiJ.c_6C2xHrvsC ELSE 0 END) > 0
ORDER BY window_total DESC
LIMIT 10;


SELECT DISTINCT t_KVR.c_0g82YslPQP,
    COUNT(*) OVER (PARTITION BY t_KVR.c_4fLRz) as window_count,
    RANK() OVER (ORDER BY CASE WHEN typeof(t_KVR.c_0g82YslPQP) IN ('null') THEN 0 
                            ELSE t_KVR.c_0g82YslPQP END DESC) as rank_val,
    CASE WHEN t_KVR.c_0g82YslPQP IS NULL THEN 'Unknown' ELSE 'Known' END as status
FROM t_KVR
WHERE t_KVR.c_0g82YslPQP IS NOT NULL
GROUP BY t_KVR.c_0g82YslPQP, t_KVR.c_4fLRz
HAVING COUNT(*) > 0
ORDER BY window_count DESC
LIMIT 20;


SELECT t_KVR.c_0g82YslPQP,
    t_KVR.c_4fLRz,
    SUM(CASE WHEN typeof(t_KVR.c_0g82YslPQP) IN ('integer', 'real', 'numeric') THEN t_KVR.c_0g82YslPQP ELSE 0 END) 
        OVER (PARTITION BY t_KVR.c_4fLRz) as window_total
FROM t_KVR
GROUP BY t_KVR.c_0g82YslPQP, t_KVR.c_4fLRz
HAVING SUM(CASE WHEN typeof(t_KVR.c_0g82YslPQP) IN ('integer', 'real', 'numeric') THEN t_KVR.c_0g82YslPQP ELSE 0 END) > 0
ORDER BY window_total DESC
LIMIT 10;