0% found this document useful (0 votes)
2 views3 pages

HN Testing Interview Questions

This document provides a list of basic SQL queries commonly asked in automation testing interviews, including selecting records, filtering, sorting, counting, grouping, and joining tables. It also includes a bonus query for finding the second highest salary and outlines common interview topics such as the differences between WHERE and HAVING, types of JOINs, and SQL usage in automation. The queries are structured to help candidates prepare for SQL-related questions in interviews.

Uploaded by

indianthatha93
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

HN Testing Interview Questions

This document provides a list of basic SQL queries commonly asked in automation testing interviews, including selecting records, filtering, sorting, counting, grouping, and joining tables. It also includes a bonus query for finding the second highest salary and outlines common interview topics such as the differences between WHERE and HAVING, types of JOINs, and SQL usage in automation. The queries are structured to help candidates prepare for SQL-related questions in interviews.

Uploaded by

indianthatha93
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Hirenexa Testing – Sql Interview questions

-- =====================================================

-- BASIC SQL QUERIES FOR AUTOMATION TESTING INTERVIEWS

-- =====================================================

-- 1. Select all records from a table

SELECT * FROM employees;

-- 2. Select specific columns

SELECT employee_id, employee_name

FROM employees;

-- 3. Filter records using WHERE

SELECT *

FROM employees

WHERE department = 'QA';

-- 4. Use AND / OR conditions

SELECT *

FROM employees

WHERE department = 'QA'

AND salary > 50000;

-- 5. Sort records using ORDER BY

SELECT *

FROM employees

ORDER BY salary DESC;


Hirenexa Testing – Sql Interview questions

-- 6. Count records

SELECT COUNT(*) AS total_employees

FROM employees;

-- 7. Group data using GROUP BY

SELECT department, COUNT(*) AS employee_count

FROM employees

GROUP BY department;

-- 8. Find duplicate records

SELECT email, COUNT(*)

FROM employees

GROUP BY email

HAVING COUNT(*) > 1;

-- 9. Join two tables

SELECT e.employee_name, d.department_name

FROM employees e

INNER JOIN departments d

ON e.department_id = d.department_id;

-- 10. Update a record

UPDATE employees

SET salary = 60000

WHERE employee_id = 101;


Hirenexa Testing – Sql Interview questions

-- =====================================================

-- BONUS: Frequently Asked Interview Query

-- Find the second highest salary

-- =====================================================

SELECT MAX(salary)

FROM employees

WHERE salary < (

SELECT MAX(salary)

FROM employees

);

-- =====================================================

-- COMMON INTERVIEW TOPICS

-- =====================================================

-- 1. Difference between WHERE and HAVING

-- 2. Types of JOINs

-- 3. DELETE vs TRUNCATE vs DROP

-- 4. Primary Key vs Foreign Key

-- 5. SQL usage in Selenium/Test Automation

-- =====================================================

You might also like