SQL Interview Questions For Software Testers
SQL Interview Questions For Software Testers
SQL Interview Questions For Software Testers
3. Q. What is a join?
A. Join is a process of retrieve pieces of data from different sets
(tables) and returns them to the user or program as one “joinedâ€
collection of data.
cross-join
SELECT * FROM table1, table2;
self join
SELECT e1.name | |’ ‘ | | e2.ename FROM emp e1, emp e2 WHERE e1.
emp_no = e2.emp_no;
12. Q. Can a table have more than one foreign key defined?
A. A table can have any number of foreign keys defined. It can have
only
one primary key defined.
13. Q. List all the possible values that can be stored in a BOOLEAN
data field.
A. There are only two values that can be stored in a BOOLEAN data
field:
-1(true) and 0(false).
15. Q. How many places to the right of the decimal can be stored in a
CURRENCY data field?
A. The CURRENCY data type can store up to four places to the right
of the
decimal. Any data beyond the fourth place will be truncated by
Visual
Basic without reporting an error.
16. Q. What is a stored procedure?
A. A procedure is a group of PL/SQL statements that can be called
by
a name. Procedures do not return values they perform tasks.
21. Q. Which of the following WHERE clauses will return only rows
that have a NULL in the PerDiemExpenses column?
A. WHERE PerDiemExpenses <>
B. WHERE PerDiemExpenses IS NULL
C. WHERE PerDiemExpenses = NULL
D. WHERE PerDiemExpenses NOT IN (*)
23. Q. Write a SQL SELECT query that only returns each city only once
from Students table?
Do you need to order this list with an ORDER BY clause?
26. Q. Write SQL SELECT example how you limiting the rows returned
with a WHERE clause.
27. Q. Write SQL SELECT query that returns the first and
last name of each instructor, the Salary,
and gives each of them a number.
31. Q. Is the WHERE clause must appear always before the GROUP BY
clause in SQL SELECT ?
A. Yes.
The proper order for SQL SELECT
clauses is: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY.
Only the SELECT and FROM clause are mandatory.
A. You use the MINUS operator to return all rows from one query
except
where duplicate rows are found in a second query. The UNION operator
returns all rows from both queries minus duplicates. The UNION ALL
operator
returns all rows from both queries including duplicates.
The INTERSECT operator returns only those rows that exist in both
queries.
Answer: j and a aliases for table names. this is outer joint select
statament from two tables.
A. 1) The COUNT function tells you how many rows were in the result set.
SELECT COUNT(*) FROM TESTING.QA
2) The AVG function tells you the average value of a numeric column.
SELECT MAX(SALARY) FROM TESTING.QA
3) The MAX and MIN functions tell you the maximum and minimum value
of a numeric column.
SELECT MIN(SALARY) FROM TESTING.QA
4) The SUM function tells you the sum value of a numeric column.
SELECT SUM(SALARY) FROM TESTING.QA
On this page I put some SQL interview questions. These SQL interview questions
are very simple and mainly were used for interviewing software testers who is
involved in database SQL testing or grey box testing. The interview questions found
above are listed in order of complexity. However all new interview questions
(regardless of there difficulty) will be added to the bottom of the list. You can find
more SQL interview questions searching the WEB.