Skip to content
InterviewEra
What is InterviewEraThe platform, founder, and missionHow It WorksAdaptive interview, live captions, scoringResume-aware ScoringCV-native questions + 5-dimension feedback
Campus Placements OverviewStructured mock interviews and cohort analytics for T&P teamsSet up Campus WorkspaceCreate your campus dashboard and invite your batchT&P Product & PricingPilot pricing, bulk onboarding, and placement trackingStudent Invitation HelpHow to accept a campus invite and start practising
Software EngineerDSA, system design, OOP roundsFrontend DeveloperReact, HTML/CSS, JavaScript interviewsTCS Interview QuestionsNQT + technical + HR roundsWipro Careers HubNLTH, WILP, Turbo hiring tracksSolera Careers HubCognitive assessment + Java/SQL roundsReact Interview QuestionsHooks, state, performance topics
Interview Question GeneratorRole-specific questions in secondsATS Resume CheckerScore your resume against job rolesSTAR Answer BuilderStructure behavioral answers clearly
All ResourcesCentral guide and hub directoryBlogInterview prep articles and guidesAgentic AI Interview GuideAI-assisted coding interviews, rubrics, and prepPlacement GuideStep-by-step campus prep playbookSTAR Method GuideMaster behavioral answers
Help CenterGuides, FAQs, and supportDSA Topic MapPatterns, roadmap, and top 50 problemsSoftware Engineer GuideSWE questions and prep hubAndroid GuideKotlin, Compose, MVVM prep hubFrontend GuideReact and JavaScript interviews
PricingFor Teams
Sign inSign up
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Mock Interview

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Free Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Interview Questions

  • Wipro Careers Hub
  • Solera Careers Hub
  • Amazon SDE Questions
  • Microsoft SDE Questions
  • Infosys SWE Questions
  • Infosys Java Questions
  • Freshworks Frontend Questions
  • Android Developer Questions
  • Frontend Developer Questions
  • Java Developer Questions

Resources

  • Community Hub
  • All Resources
  • Blog
  • Agentic AI Interview Guide
  • What Is Agentic AI
  • Agentic Coding Round
  • AI Prompt Engineering
  • Cursor AI Interview Guide
  • DSA Topic Map
  • Placement Guide
  • STAR Guide
  • HR Guide
  • Interview Tips

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact

© 2026 InterviewEra. All rights reserved.

Privacy PolicyTermsRefundRanchi, Jharkhand, India
Interview Questions›Topics›SQL

Database · Fresher-relevant

SQL Interview Questions 2026

SQL interview questions on JOINs, aggregations, subqueries, indexing, and query optimisation — the most-tested database skill at Indian companies.

DatabaseFresher-relevant

SQL Interview Questions

Placement-oriented · Updated 2026
  1. 01

    What is the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN?

    TechnicalEasy

    Tip: INNER JOIN returns only matching rows in both tables. LEFT JOIN returns all left rows plus matches (NULLs where none). FULL OUTER JOIN returns all rows from both, matched where possible. Draw it mentally as set intersection vs union.

  2. 02

    What is the difference between WHERE and HAVING?

    TechnicalEasy

    Tip: WHERE filters individual rows before grouping; HAVING filters groups after GROUP BY and can use aggregates like COUNT(*) > 5. You cannot use an aggregate in WHERE. Logical order: FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY.

  3. 03

    Write a query to find the Nth highest salary.

    TechnicalMedium

    Tip: Use DENSE_RANK(): SELECT salary FROM (SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) rnk FROM employees) t WHERE rnk = N. DENSE_RANK handles ties correctly. Alternatively LIMIT 1 OFFSET N-1 on distinct salaries when there are no ties.

  4. 04

    What is an index and what are its trade-offs?

    TechnicalMedium

    Tip: An index (usually a B+ tree) speeds up lookups and range scans by avoiding full table scans, at the cost of extra storage and slower writes (each INSERT/UPDATE maintains it). Index columns used in WHERE/JOIN/ORDER BY; composite-index column order follows the leftmost-prefix rule.

  5. 05

    Explain the ACID properties of a transaction.

    TechnicalMedium

    Tip: Atomicity (all-or-nothing), Consistency (constraints preserved), Isolation (concurrent transactions do not corrupt each other), Durability (committed data survives crashes). Isolation levels (Read Committed, Repeatable Read, Serializable) trade consistency against concurrency.

  6. 06

    What is normalisation and when would you denormalise?

    TechnicalMedium

    Tip: Normalisation (1NF→3NF) removes redundancy and update anomalies by splitting data into related tables. Denormalise (duplicate data, add summary columns) deliberately for read-heavy/reporting workloads to avoid expensive joins — accepting redundancy for query speed.

  7. 07

    What are window functions and how do they differ from GROUP BY?

    TechnicalHard

    Tip: Window functions (ROW_NUMBER, RANK, SUM() OVER, LAG/LEAD) compute across a set of rows related to the current row without collapsing them — GROUP BY collapses rows into one per group. Use OVER(PARTITION BY ... ORDER BY ...) for running totals, rankings, and period-over-period comparisons.

  8. 08

    How do you find and fix a slow query?

    TechnicalHard

    Tip: Run EXPLAIN / EXPLAIN ANALYZE to see the plan: look for full table scans, missing indexes, and bad row estimates. Add or fix indexes, avoid functions on indexed columns in WHERE (non-sargable), select only needed columns, and consider rewriting correlated subqueries as joins.

Practice SQL questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need SQL

  • Software Engineer questions
  • Java Developer questions
  • Python Developer questions
  • Data Analyst questions
  • Backend Developer questions

Related database topics

  • MySQL questions
  • MongoDB questions
  • PostgreSQL questions
  • Redis questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples