PL/SQL & T-SQL (Oracle and SQL Server) Module 1
Start here: two engines, versions and a verified lab interview questions
Interview questions on “Start here: two engines, versions and a verified lab”: warm-ups, then what each harder question tests and how a good answer starts.
Warm-up questions
Short questions with short answers, each answered in full.
-
Fresher to mid
How do PL/SQL and T-SQL differ?
Answered in the lesson PL/SQL and T-SQL: what they are and where they run
-
Fresher to mid
Why bind a database container's port to 127.0.0.1?
Answered in the lesson Set up a lab with Oracle 26ai and SQL Server 2025
-
Fresher to mid
How do Oracle and SQL Server treat an empty string?
Answered in the lesson The practice schema and dialect basics
Questions with model answers
What each question tests, the first step of a good answer and the follow-ups to expect.
-
Mid to senior
After an upgrade to Oracle AI Database 26ai, a package that tests DBMS_DB_VERSION.VERSION >= 26 still runs its old code path, without any error. What is wrong, and how do you write version checks that survive the next release?
- What it tests
- Reading Oracle's version numbers, knowing what conditional compilation does with a false test, and making version checks explicit and tested on every release they must support.
- First step
- Compare the product name with the version the engine reports: a 26ai banner reads Release 23.26.x, where 23 is the major release and 26 the year of the release update, and DBMS_DB_VERSION.VERSION holds the major release.
- Follow-ups
-
- Why did the package compile without an error?
- How would you see which branch was compiled?
- What changes for 19c?
From the lesson PL/SQL and T-SQL: what they are and where they run
Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.Opening the model answers with your pass…
Model answers open with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so the model answers can’t be opened at the moment. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Mid to staff
A team argues whether a funds transfer (check the balance, move the money, write an audit row) belongs in a stored procedure or in the application service. How would you decide, and what would you put on each side?
- What it tests
- Separating invariants that every writer must respect from workflow logic, and weighing round trips, transactions, permissions, testing and portability.
- First step
- Ask what must hold for every program that writes to the accounts: money is never created or lost, so the debit, the credit and the audit row commit together. That invariant belongs next to the data; the rest is workflow.
- Follow-ups
-
- What if the team uses an ORM for everything?
- How do you stop two transfers from overdrawing the same account?
- When would you move the rule out of the database?
From the lesson PL/SQL and T-SQL: what they are and where they run
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
A colleague committed lab.env, with the SQL Server sa password, and pushed it to the team's shared repository an hour ago. What do you do, in what order, and what stops it from happening again?
- What it tests
- Treating a pushed secret as exposed, rotating before cleaning history, and preventing repeats with ignore rules, generated per-person secrets and checks before a push.
- First step
- Assume the password is known to everyone who can read the repository, including clones and caches. Change it first, on every server that uses it, and only then clean the file out of the repository and its history.
- Follow-ups
-
- Why is deleting the file in a new commit not enough?
- What if the same password is used on a shared test server?
- How do you stop the next push before it leaves a laptop?
From the lesson Set up a lab with Oracle 26ai and SQL Server 2025
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
A customer search ported from SQL Server to Oracle no longer finds customers without a phone number, and a load that worked on SQL Server now fails on a NOT NULL column. What changed, and how do you fix the code and the data?
- What it tests
- Knowing that Oracle stores the empty string as NULL, finding every place that depends on it, and choosing one representation of "no value" for both engines.
- First step
- Look for comparisons with '' and for columns that held empty strings on SQL Server. In Oracle '' is NULL, so phone = '' is never true and an empty string in a NOT NULL column is a NULL that the constraint refuses.
- Follow-ups
-
- How would you find every place in the code that depends on empty strings?
- What should the NOT NULL column hold for a customer with no phone number?
- Does concatenation change too?
From the lesson The practice schema and dialect basics
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Fresher to senior
A CI job compares the error messages of a schema's tests with recorded ones, and the comparison breaks on every fresh build: one run says SYS_C008715, the next SYS_C008731. What is happening, and what would you change?
- What it tests
- Recognising generated constraint names, naming every constraint, and writing tests that check meaning rather than accidents of a build.
- First step
- The numbered name belongs to a constraint that was created without one: Oracle names it SYS_Cn, and SQL Server generates a name too, so each rebuild gives a new one. Give the constraint a name in the DDL.
- Follow-ups
-
- Which constraints most need names?
- How do you rename the constraints of an existing database safely?
- What should the test compare instead of the whole message?
From the lesson The practice schema and dialect basics
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
All PL/SQL & T-SQL (Oracle and SQL Server) interview questions · The PL/SQL & T-SQL (Oracle and SQL Server) track