Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

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.

8 questions: 3 warm-ups and 5 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. 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

  2. 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

  3. 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.

  1. 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

    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.

    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
  2. 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

    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
  3. 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

    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
  4. 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

    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
  5. 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

    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

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.