0 Comments

Looking to crack an Infosys interview? Whether youโ€™re applying for the role of System Engineer, Analyst, or Developer, one area you absolutely cannot ignore is SQL. This article focuses on real SQL queries asked in Infosys interviews, collected from placement drives, student experiences, and campus recruitment rounds.

So if you’re searching for “SQL queries asked in Infosys“, this is your one-stop guide to get ahead.


๐Ÿง  Why Infosys Asks SQL Queries in Interviews

Infosys works with large-scale enterprise applications, and SQL is fundamental to database interaction, data analysis, and back-end development. Interviewers want to assess your:

  • Understanding of data structures
  • Knowledge of SQL syntax and logic
  • Problem-solving skills with data
  • Familiarity with joins, subqueries, and grouping

๐Ÿ“Œ Common SQL Queries Asked in Infosys Interviews

These SQL queries are commonly asked in Infosys on-campus and off-campus interviews. Make sure to practice each query and understand the logic behind them.


๐Ÿ”น 1. Find the second highest salary from the employee table.

SELECT MAX(Salary)
FROM Employees
WHERE Salary < (SELECT MAX(Salary) FROM Employees);

๐Ÿ”น 2. Retrieve employee names starting with the letter ‘A’.

SELECT Name
FROM Employees
WHERE Name LIKE 'A%';

๐Ÿ”น 3. Count the number of employees in each department.

SELECT Department, COUNT(*) AS Total
FROM Employees
GROUP BY Department;

๐Ÿ”น 4. Get all employees who joined after 2021.

SELECT * 
FROM Employees
WHERE JoinDate > '2021-01-01';

๐Ÿ”น 5. Write a query to get the highest paid employee from each department.

SELECT Department, MAX(Salary) AS MaxSalary
FROM Employees
GROUP BY Department;

๐Ÿ”น 6. Fetch details of employees not assigned to any project (ProjectID is NULL).

SELECT * 
FROM Employees
WHERE ProjectID IS NULL;

๐Ÿ”น 7. Display employee details in ascending order of salary.

SELECT * 
FROM Employees
ORDER BY Salary ASC;

๐Ÿ”น 8. Get department-wise average salary.

SELECT Department, AVG(Salary) AS AvgSalary
FROM Employees
GROUP BY Department;

๐Ÿ”น 9. Write a query to find duplicate employee records based on email.

SELECT Email, COUNT(*) 
FROM Employees
GROUP BY Email
HAVING COUNT(*) > 1;

๐Ÿ”น 10. Join Employees and Departments table to get department name along with employee details.

SELECT e.Name, d.DepartmentName 
FROM Employees e
JOIN Departments d ON e.DeptID = d.ID;

๐Ÿ”„ Real Infosys SQL Coding Round Format

In Infosys interviews, the SQL section can appear in:

  1. Technical MCQ Round โ€“ Objective SQL syntax-based questions.
  2. Live Coding Round โ€“ Youโ€™ll need to write queries based on provided table data.
  3. Face-to-Face Interviews โ€“ The interviewer might ask you to explain or write queries on a whiteboard or live editor.

๐Ÿ’ก Tips to Ace SQL in Infosys Interviews

  • Focus on real-world query writing, not just memorization.
  • Revise JOINs, GROUP BY, HAVING, and subqueries.
  • Practice queries on LeetCode, HackerRank, or SQLZoo.
  • Donโ€™t ignore NULL values, string patterns, and sorting/filtering logic.

โ“FAQs โ€“ SQL Queries Asked in Infosys

Q1: How many SQL queries are asked in Infosys interviews?

You can expect 1โ€“3 SQL queries depending on the role. Freshers are usually asked basics, while experienced candidates may get complex JOINs or subqueries.

Q2: Is SQL mandatory for Infosys interviews?

Yes, especially for roles involving databases, analytics, or full-stack development.

Q3: What is the best way to practice SQL queries for Infosys?

Use online platforms like HackerRank, Mode Analytics, or install MySQL/PostgreSQL locally to simulate query writing in real tables.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts