Assume you have a product table. How would you schedule a daily refresh at 5:00 UTC?
💡 Model Answer
To schedule a daily refresh of a product table at 5:00 UTC, you can use a database scheduler or an external orchestrator. In Snowflake, you would create a task that runs a COPY INTO or MERGE statement and set its schedule using a cron expression:
CREATE OR REPLACE TASK refresh_product
WAREHOUSE = my_wh
SCHEDULE = 'USING CRON 0 5 * * * UTC'
AS
MERGE INTO product p
USING staging_product s
ON p.id = s.id
WHEN MATCHED THEN UPDATE SET p.name = s.name, p.price = s.price
WHEN NOT MATCHED THEN INSERT (id, name, price) VALUES (s.id, s.name, s.price);Enable the task with ALTER TASK refresh_product RESUME;. The cron expression ensures the task runs every day at 05:00 UTC. If your DBMS lacks a built‑in scheduler, you could use cron on a server or a cloud scheduler (e.g., AWS EventBridge) to trigger a stored procedure or a script that performs the refresh.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500