PGoCareerGoCareer prep tools
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

SQL · Theory

Stored

← All stacks

Theory

291/439

Stored

Stored programs in MySQL: procedures, functions, triggers, events. They live in the database. The CLI needs a different DELIMITER to define them.

Functions — SELECT fn(marks). Procedures: CALL. Triggers: automatic. Events: scheduled (like a cron inside MySQL).

Trap — ‘stored’ as a vague word without saying which of the four.

On the example next to this theory: Stored: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Exam tip

Four stored objects. DELIMITER when you CREATE them.

Stored — sample query

-- Stored
CREATE TABLE demo (
  id INTEGER PRIMARY KEY,
  label TEXT NOT NULL,
  qty INTEGER DEFAULT 0
);
INSERT INTO demo (id, label, qty) VALUES
  (1, 'alpha', 2),
  (2, 'beta', 5);
SELECT label, qty FROM demo WHERE qty >= 2 ORDER BY qty DESC;

Stored: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Short notes

  • DefStored programs = procedure, function, trigger, event.
  • RuleCALL vs SELECT vs automatic vs schedule.
  • TrapMixing procedure and function.

Questions

1

Procedure vs function?

291 / 439

P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.