LUCENT GRID
SQL Lab ยท Stored Procedures โ€” Medium
Loading ops_db...
๐Ÿ–ฅ๏ธ
SQL Terminal
๐Ÿ“
Procedure Editor
๐Ÿ“…
Scheduler
๐Ÿ“Œ OBJECTIVES
โ—‹Create basic stored procedure
โ—‹Add IN parameter (date range)
โ—‹Add OUT parameter (total)
โ—‹Use IF/THEN logic inside proc
โ—‹Call procedure successfully
โ—‹Schedule Monday automation
0 / 6 complete
SQL TERMINAL โ€” ops_db
MySQL 8.0 โ€” ops_db Tables: orders, products, reps, regions Task: Automate the Monday weekly report with a stored procedure โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
mysql>
PROCEDURE EDITOR
weekly_report.sql
AUTOMATION SCHEDULER
Scheduled procedure runs โ€” deploy your procedure then register it here.
weekly_report
Not deployed
PENDING
Once deployed, click Schedule to register the Monday automation. Then run:
CALL weekly_report('2024-01-01','2024-01-07',@total);
to test it manually.
โ˜ฐ BRIEF
๐Ÿ–ฅ Terminal
๐Ÿ“ Editor
๐Ÿ“… Scheduler
MISSION BRIEF

MISSION BRIEFING

STORED PROCEDURES โ€” VANTAGE OPERATIONS

SCENARIO

Every Monday morning, the Vantage Operations team manually runs the same 12-step sales report. It takes 40 minutes and often has errors. Your job is to build a stored procedure that accepts a date range, produces the full regional breakdown, calculates total revenue as an OUT parameter, uses IF/THEN logic to flag whether the target was met, and can be scheduled to run automatically.

PROCEDURE STRUCTURE

  • IN start_date DATE โ€” report period start
  • IN end_date DATE โ€” report period end
  • OUT total_revenue DECIMAL โ€” populated by SELECT INTO
  • SELECT summary with GROUP BY region
  • IF total > 100000 THEN 'TARGET MET'

COMMANDS

  • Edit the procedure in the Procedure Editor window
  • Click CREATE & DEPLOY to create it
  • SHOW PROCEDURE STATUS WHERE Db = 'ops_db';
  • CALL weekly_report('2024-01-01', '2024-01-07', @total);
  • SELECT @total;
  • DROP PROCEDURE IF EXISTS weekly_report;

TIP

The procedure is pre-written in the editor. Read through it carefully, then deploy it and test with CALL. Once deployed, register it in the Scheduler window to complete the automation objective.

Display Mode
LAB COMPLETE
๐Ÿ†
AUTOMATION DEPLOYED
Stored Procedures โ€” Vantage Operations
โšก
+100 XP
EXPERIENCE EARNED
โฌ† LEVEL UP โ€” Level
โ†’ Return to Labs