prueba tecnica

This commit is contained in:
Alejandro
2025-06-15 18:29:25 +02:00
parent 9758ee0bc6
commit d97e55a83f
127 changed files with 6488 additions and 1 deletions

15
db/06_CheckRateExists.sql Normal file
View File

@@ -0,0 +1,15 @@
DROP FUNCTION IF EXISTS public.check_rate_exists(INTEGER);
CREATE OR REPLACE FUNCTION public.check_rate_exists(p_id INTEGER)
RETURNS INTEGER
AS $$
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM public.rates
WHERE id = p_id
)
THEN 1
ELSE 0
END;
$$ LANGUAGE SQL STABLE;