Get the new user's id right after insert
You're registering a new customer and want to grab their generated identifier immediately — to attach a first order or show it in the UI.
A second query just for that is a wasted round-trip. Add a new customer named «Петя» to customers and, in the same statement, return the generated id along with the name — no separate SELECT.
Expected output sample
This is what a correct answer looks like — its row count is its own, it doesn't have to match the schema tables.
| id | name |
|---|---|
| 5 | Петя |
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign inFocus radio
Paused · SomaFM · Fluid