Trending: Crack FAANG with our new JavaScript Interview Mastery!Try Now
Back to Curriculum
AI Prompt EngineeringModuleLesson 01

SQL & Regex Generation

15m
Beginner
+50 XP
0% Done

The Arcane Languages

Most developers don't write complex SQL joins or Regular Expressions (Regex) every day. When the time comes to write one, it usually involves an hour of Googling syntax.

AI models are exceptionally good at translating plain English into highly complex SQL queries or Regex patterns.

The Regex Prompt

"Write a Regex pattern that matches a valid phone number. It must support optional country codes (+1), support parentheses around the area code, and support both dashes and spaces as separators. Provide 3 test cases that match, and 3 that fail."

The SQL Prompt

"Write a PostgreSQL query. I have a 'users' table and an 'orders' table. Return the top 5 users who have spent the most money in the last 30 days. Include their email and the total amount spent."