Interview Questions For Software Developer
Basic & Advanced SQL Interview Questions And Answers:
- Puzzle Interview Questions For Software Developer
- Application Developer Interview Questions
- Interview Questions For Software Developer With Answers
Basic & Advanced SQL Interview Questions And Answers: Congratulations! You got the interview! In this SQL Server Developer Interview Questions post, we have put together both basic and advanced SQL Interview Questions and Answers. This post contains Top SQL Interview Questions for Experienced as well as Freshers.
Congratulations! You got the interview! In this SQL Server Developer Interview Questions post, we have put together both basic and advanced SQL Interview Questions and Answers. This post contains Top SQL Interview Questions for Experienced as well as Freshers.
- 10 things you may be asked during a developer interview (and how to handle them). Many software developers I have talked to absolutely dread job interviews. Some are standard interview.
- Welcome to Top 20 Software Developer (engineer) Interview Questions and Answers. This article is specifically designed to help you prepare for an interview and provide confidence boost so that you get that awesome job. All questions and answers are researched and contributed by a professional software developer.
- Software engineers are responsible for developing, testing, deploying, and revamping computer programs. If you're interviewing for a position as a software engineer, it helps to know what types of questions to expect.
- In this article we treat behavioral questions as a way to prescreen candidates during a face to face interview with a technical recruiter. To be able to draw valuable conclusions you need to ask the right questions. That was the main reason why we wrote this article. Of course, it’s not the only approach.
I have segregated this “SQL Server Interview Questions” post into two types.
1. Common SQL Interview Questions
2. Practical SQL Query Interview Questions (SQL Server Queries examples with answers).
I don’t want to take much time of yours but I couldn’t move further without mentioning about this inevitable job interview question which every hiring manager asks you in any interview i.e., Tell Me About Yourself. Answering these questions is very easy if you follow the link. It contains sample answers for both freshers and experienced. Now, Let’s move on to the actual post.
General SQL Interview Questions:
1. What is a Database?
A database is a collection of information in an organized form for faster and better access, storage and manipulation. It can also be defined as a collection of tables, schema, views, and other database objects.
2. What is Data warehouse?
Data warehouse refers to a central repository of data from multiple sources of information. Those data are consolidated, transformed and made available for the mining as well as online processing.
3. What is a Table in a Database?
A table is a database object used to store records in a field in the form of columns and rows that holds data.
4. What is a Field in a Database?
A field in a Database table is a space allocated to store a particular record within a table.
5. What is a Record in a Database?
A record (also called a row of data) is an ordered set of related data in a table.
6. What is a column in a Table?
A column is a vertical entity in a table that contains all information associated with a specific field in a table.
7. What is DBMS?
Database Management System is a collection of programs that enables a user to store, retrieve, update and delete information from a database.
8. What are the types of DBMS?
There are two types of DBMS
1. Relational Database Management System (RDBMS)
2. Non-Relational Database Management System
9. What is RDBMS?
RDBMS stands for Relational Database Management System. RDBMS is a database management system (DBMS) that is based on the relational model. Data from a relational database can be accessed using Structured Query Language (SQL)
10. What are the popular Database Management Systems in the IT Industry?
Oracle, MySQL, Microsoft SQL Server, PostgreSQL, Sybase, MongoDB, DB2, and Microsoft Access etc.,
11. What is SQL?
SQL Overview: SQL stands for Structured Query Language. It is an American National Standard Institute (ANSI) standard. It is a standard language for accessing and manipulating databases. Using SQL, some of the action we could do are to create databases, tables, stored procedures (SP’s), execute queries, retrieve, insert, update, delete data against a database.
12. What are the different types of SQL commands?
SQL commands are segregated into the following types:
- DDL – Data Definition Language
- DML – Data Manipulation Language
- DQL – Data Query Language
- DCL – Data Control Language
- TCL – Transaction Control Language
13. What are the different DDL commands in SQL?
DDL commands are used to define or alter the structure of the database.
- CREATE: To create databases and database objects
- ALTER: To alter existing database objects
- DROP: To drop databases and databases objects
- TRUNCATE: To remove all records from a table but not its database structure
- RENAME: To rename database objects
14. What are the different DML commands in SQL?
DML commands are used for managing data present in the database.
- SELECT: To select specific data from a database
- INSERT: To insert new records into a table
- UPDATE: To update existing records
- DELETE: To delete existing records from a table
15. What are the different DCL commands in SQL?
DCL commands are used to create roles, grant permission and control access to the database objects.
- GRANT: To provide user access
- DENY: To deny permissions to users
- REVOKE: To remove user access
16. What are the different TCL commands in SQL?
TCL commands are used to manage the changes made by DML statements.
- COMMIT: To write and store the changes to the database
- ROLLBACK: To restore the database since the last commit
17. What is an Index?
An index is used to speed up the performance of queries. It makes faster retrieval of data from the table. The index can be created on one column or a group of columns.
18. What are all the different types of indexes?
There are three types of indexes
1. Unique Index: Unique Indexes helps maintain data integrity by ensuring that no two rows of data in a table have identical key values. A unique index can be applied automatically when a primary key is defined. It ensures that the values in the index key columns are unique.
2. Clustered Index: Clustered Index reorders the physical order of the table and search based on the key values. There will be only one clustered index per table.
3. Non-Clustered Index: Non-Clustered Index doesn’t alter the physical order of the table and maintains a logical order of the data. Each table can have many non-clustered indexes.
19. What is the difference between Cluster and Non-Cluster Index?
The difference between the clustered and non-clustered index in SQL is as follows:
Clustered Index:
It is used for easy retrieval of data from the database and it is faster.
One table can only have one clustered index
It alters the way records are stored in a database as it sorts out rows by the column which is set to be clustered index.
Non-Clustered Index:
It is slower compared to the Clustered index.
One table can have multiple non clustered index
It doesn’t alter the way it was sorted but it creates a separate object within a table which points back to the original table rows after searching.
20. What is a View?
A view is like a subset of a table which is stored logically in a database. A view is a virtual table. It contains rows and columns similar to a real table. The fields in the view are fields from one or more real tables. Views do not contain data of their own. They are used to restrict access to the database or to hide data complexity.
CREATE VIEW view_name ASSELECT column_name1,column_name2 FROM table_name WHERE CONDITION; |
21. What are the advantages of Views?
Some of the advantages of Views are
- Views occupy no space
- Views are used to simply retrieve the results of complicated queries that need to be executed often.
- Views are used to restrict access to the database or to hide data complexity.
22. What is a relationship and what are they?
Database Relationship is defined as the connection between the tables in a database. There are various database relationships namely
1. One to One Relationship
2. One to Many Relationship
3. Many to One Relationship
4. Self-Referencing Relationship
23. What is a query?
A database query is a request for data or information from a database table or combination of tables. A database query can be either a select query or an action query.
24. What is a Subquery?
A Subquery is a SQL query within another query. It is a subset of a Select statement whose return values are used in filtering the conditions of the main query.
25. What are the types of subquery?
There are two types of subquery:
1. Correlated: In a SQL database query, a correlated subquery is a subquery that uses values from the outer query in order to complete. Because a correlated subquery requires the outer query to be executed first, the correlated subquery must run once for every row in the outer query. It is also known as a synchronized subquery.
2. Non-Correlated: A Non-correlated subquery is a subquery in which both outer query and inner query are independent to each other.
26. What is Synchronized Subquery?
Refer Correlated Subquery.
27. What is the difference between Local Variables and Global Variables?
Local Variables: Local variables can be used or exist only inside the function. These variables are not used or referred by any other functions. These are not known to other functions. Variables can be created whenever that function is called.
Global Variables: Global variables can be used or exist throughout the program. Same variable declared in global cannot be used in functions. Global variables cannot be created whenever that function is called.
28. What is data Integrity?
Data integrity defines the accuracy and consistency of the data stored in a database. It also defines integrity constraints to enforce business rules on the data when it is entered into an application or a database.
29. What is Auto Increment in SQL?
It is one of the important Oracle DBA Interview Questions.
Auto increment keyword allows the user to create a unique number to get generated when a new record is inserted into a table. Auto increment keyword can be used whenever Primary Key is used.
AUTO INCREMENT keyword is used in Oracle and IDENTITY keyword is used in SQL Server.
30. What is a temp table?
Ans. A temp table is a temporary storage structure to store the data temporarily.
31. How to avoid duplicate records in a query?
The SQL SELECT DISTINCT query is used to return only unique values. It eliminates all the duplicated values.
View Detailed Post
32. What is the difference between Rename and Alias?
‘Rename’ is a permanent name given to a table or column
‘Alias’ is a temporary name given to a table or column.
33. What is a Join?
Join is a query, which retrieves related columns or rows from multiple tables.
34. What are the different types of joins?
Types of Joins are as follows:
- INNER JOIN
- LEFT JOIN
- RIGHT JOIN
- OUTER JOIN
35. What is the difference between an inner and outer join?
An inner join returns rows when there is at least some matching data between two (or more) tables that are being compared.
An outer join returns rows from both tables that include the records that are unmatched from one or both the tables.
36. What are SQL constraints?
SQL constraints are the set of rules that enforced some restriction while inserting, deleting or updating of data in the databases.
37. What are the constraints available in SQL?
Some of the constraints in SQL are – Primary Key, Foreign Key, Unique Key, SQL Not Null, Default, Check and Index constraint.
38. What is a Unique constraint?
A unique constraint is used to ensure that there are no duplication values in the field/column.
39. What is a Primary Key?
A PRIMARY KEY constraint uniquely identifies each record in a database table. All columns participating in a primary key constraint must not contain NULL values.
40. Can a table contain multiple PRIMARY KEY’s?
The short answer is no, a table is not allowed to contain multiple primary keys but it allows to have one composite primary key consisting of two or more columns.
41. What is a Composite PRIMARY KEY?
Composite PRIMARY KEY is a primary key created on more than one column (combination of multiple fields) in a table.
42. What is a FOREIGN KEY?
A FOREIGN KEY is a key used to link two tables together. A FOREIGN KEY in a table is linked with the PRIMARY KEY of another table.
43. Can a table contain multiple FOREIGN KEY’s?
A table can have many FOREIGN KEY’s.
44. What is the difference between UNIQUE and PRIMARY KEY constraints?
There should be only one PRIMARY KEY in a table whereas there can be any number of UNIQUE Keys.
PRIMARY KEY doesn’t allow NULL values whereas Unique key allows NULL values.
45. What is a NULL value?
A field with a NULL value is a field with no value. A NULL value is different from a zero value or a field that contains spaces. A field with a NULL value is one that has been left blank during record creation. Assume, there is a field in a table is optional and it is possible to insert a record without adding a value to the optional field then the field will be saved with a NULL value.
46. What is the difference between NULL value, Zero, and Blank space?
As I mentioned earlier, Null value is field with no value which is different from zero value and blank space.
Null value is a field with no value.
Zero is a number
Blank space is the value we provide. The ASCII value of space is CHAR(32).
47. How to Test for NULL Values?
A field with a NULL value is a field with no value. NULL value cannot be compared with other NULL values. Hence, It is not possible to test for NULL values with comparison operators, such as =, <, or <>. For this, we have to use the IS NULL and IS NOTNULL operators.
SELECT column_names FROM table_name WHERE column_name ISNULL; |
SELECT column_names FROM table_name WHERE column_name ISNOTNULL; |
48. What is SQL NOT NULL constraint?
NOT NULL constraint is used to ensure that the value in the filed cannot be a NULL
49. What is a CHECK constraint?
A CHECK constraint is used to limit the value that is accepted by one or more columns.
E.g. ‘Age’ field should contain only the value greater than 18.
CREATE TABLE EMP_DETAILS(EmpID intNOTNULL,NAME VARCHAR(30)NOTNULL,Age INTCHECK(AGE>18),PRIMARY KEY(EmpID)); |
50. What is a DEFAULT constraint?
DEFAULT constraint is used to include a default value in a column when no value is supplied at the time of inserting a record.
51. What is Normalization?
Normalization is the process of table design to minimize the data redundancy.
52. What are all the different Normalization?
There are different types of Normalization forms in SQL.
- First Normal Form (1NF)
- Second Normal Form (2NF)
- Third Normal Form (3NF)
- Boyce and Codd Normal Form (BCNF)
53. What is Denormalization?
Denormalization is a database optimization technique used to increase the performance of a database infrastructure. It involves in the process of adding redundant data to one or more tables. In a normalized database, we store data in separate logical tables and attempt to minimize redundant data.
54. What is Stored procedure?
A Stored Procedure is a collection of SQL statements that have been created and stored in the database to perform a particular task. The stored procedure accepts input parameters and processes them and returns a single value such as a number or text value or a result set (set of rows).
55. What is a Trigger?
A Trigger is a SQL procedure that initiates an action in response to an event (Insert, Delete or Update) occurs. When a new Employee is added to an Employee_Details table, new records will be created in the relevant tables such as Employee_Payroll, Employee_Time_Sheet etc.,
56. Explain SQL Data Types?
In SQL Server, each column in a database table has a name and a data type. We need to decide what type of data to store inside each and every column of a table while creating a SQL table.
Puzzle Interview Questions For Software Developer
57. What are the possible values that can be stored in a BOOLEAN data field?
TRUE and FALSE
58. What is the largest value that can be stored in a BYTE data field?
The largest number that can be represented in a single byte is 11111111 or 255. The number of possible values is 256 (i.e. 255 (the largest possible value) plus 1 (zero), or 28).
59. What are Operators available in SQL?
SQL Operator is a reserved word used primarily in an SQL statement’s WHERE clause to perform operations, such as arithmetic operations and comparisons. These are used to specify conditions in an SQL statement.
There are three types of Operators.
- Arithmetic Operators
- Comparison Operators
- Logical Operators
60. Which TCP/IP port does SQL Server run?
By default, it is 1433
61. List out the ACID properties and explain?
Following are the four properties of ACID. These guarantees that the database transactions are processed reliably.
- Atomicity
- Consistency
- Isolation
- Durability
62. Define the SELECT INTO statement.
The SELECT INTO statement copies data from one table into a new table. The new table will be created with the column-names and types as defined in the old table. You can create new column names using the AS clause.
SELECT *INTO newtable FROM oldtable WHERE condition; |
63. What is the difference between Delete, Truncate and Drop command?
The difference between the Delete, Truncate and Drop command is
- Delete command is a DML command, it is used to delete rows from a table. It can be rolled back.
- Truncate is a DDL command, it is used to delete all the rows from the table and free the space containing the table. It cant be rolled back.
- Drop is a DDL command, it removes the complete data along with the table structure(unlike truncate command that removes only the rows). All the tables’ rows, indexes, and privileges will also be removed.
64. What is the difference between Delete and Truncate?
The difference between the Delete, and Truncate are
DELETE | TRUNCATE |
---|---|
Delete statement is used to delete rows from a table. It can be rolled back. | Truncate statement is used to delete all the rows from the table and free the space containing the table. It cant be rolled back. |
We can use WHERE condition in DELETE statement and can delete required rows | We cant use WHERE condition in TRUNCATE statement. So we cant delete required rows alone |
We can delete specific rows using DELETE | We can only delete all the rows at a time using TRUNCATE |
Delete is a DML command | Truncate is a DDL command |
Delete maintains log and performance is slower than Truncate | Truncate maintains minimal log and performance wise faster |
We need DELETE permission on Table to use DELETE command | We need at least ALTER permission on the table to use TRUNCATE command |
65. What is the difference between Union and Union All command?
This is one of the tricky SQL Interview Questions. Interviewer may ask you this question in another way as what are the advantages of Union All over Union.
Both Union and Union All concatenate the result of two tables but the way these two queries handle duplicates are different.
Union: It omits duplicate records and returns only distinct result set of two or more select statements.
Union All: It returns all the rows including duplicates in the result set of different select statements.
Performance wise Union All is faster than Union, Since Union All doesn’t remove duplicates. Union query checks the duplicate values which consumes some time to remove the duplicate records.
Assume: Table1 has 10 records, Table2 has 10 records. Last record from both the tables are same.
If you run Union query.
2 | UNION |
Output: Total 19 records
Aug 01, 2010 Adaptive Filter Theory (5th Edition) Simon O. Haykin on Amazon.com.FREE. shipping on qualifying offers. Adaptive Filter Theory, 5e, is ideal for courses in Adaptive Filters. Haykin examines both the mathematical theory behind various linear adaptive filters and the elements of supervised multilayer perceptrons. Adaptive filter theory 5th pdf. Adaptive Filter Theory 5th Edition pdf - Simon O. Pearsonchoices products are or even sure how different. It very impressive but there's a reference to source. This highly successful book to convey knowledge. Established book has been deleted and media formats to this. He shows the many pages back, because mr choose from ursi practical. Aug 01, 2010 Adaptive Filter Theory - Kindle edition by Simon O. Download it once and read it on your Kindle device, PC, phones or tablets. Use features like bookmarks, note taking and highlighting while reading Adaptive Filter Theory. For courses in Adaptive Filters. Haykin examines both the mathematical theory behind various linear adaptive filters and the elements of supervised multilayer perceptrons. In its fifth edition, this highly successful book has been updated and refined to stay current with the field and develop.
If you run Union query.
2 | UNION ALL |
Output: Total 20 records
Data type of all the columns in the two tables should be same.
66. What is CLAUSE in SQL?
SQL CLAUSE helps to limit the result set by providing a condition to an SQL Query. A CLAUSE helps to filter the rows from the entire set of records. SQL CLAUSES are WHERE & HAVING.
67. What is the difference between Having and Where clause?
Where clause is used to fetch data from a database that specifies particular criteria whereas a Having clause is used along with ‘GROUP BY’ to fetch data that meets particular criteria specified by the Aggregate functions. Where clause cannot be used with Aggregate functions, but the Having clause can.
68. What are aggregate functions in SQL?
SQL aggregate functions return a single value, calculated from values in a column. Some of the aggregate functions in SQL are as follows
- AVG() – This function returns the average value
- COUNT() – This function returns the number of rows
- MAX() – This function returns the largest value
- MIN() – This function returns the smallest value
- ROUND() – This function rounds a numeric field to the number of decimals specified
- SUM() – This function returns the sum
69. What are string functions in SQL?
SQL string functions are used primarily for string manipulation. Some of the widely used SQL string functions are
- LEN() – It returns the length of the value in a text field
- LOWER() – It converts character data to lower case
- UPPER() – It converts character data to upper case
- SUBSTRING() – It extracts characters from a text field
- LTRIM() – It is to remove all whitespace from the beginning of the string
- RTRIM() – It is to remove all whitespace at the end of the string
- CONCAT() – Concatenate function combines multiple character strings together
- REPLACE() – To update the content of a string.
70. What are user defined functions?
As the name suggests these are written by users as per their requirement. User-defined functions are the functions written to use a logic whenever required.
71. What are all types of user-defined functions?
There are three types of user-defined function, namely
• Scalar Functions
• Inline Table-valued functions
• Multi-statement valued functions
Scalar functions return unit, variant defined the return clause.
Inline Table-valued functions and Multi-statement valued functions return table as a return.
72. What is Self-Join?
A self-join is a join in which a table is joined with itself, especially when the table has a Foreign Key which references its own Primary Key.
73. What is Cross-Join?
Cross join produces a result set which is the number of rows in the first table multiplied by a number of rows in the second table if no WHERE clause is used along with Cross join. This kind of result is known as Cartesian Product. If suppose, Where clause is used in cross join then the query will work like an Inner join.
74. What is Collation?
Collation is defined as a set of rules that determine how character data can be sorted as well as compared. Character data is sorted using rules that define the correct character sequence along with options for specifying case-sensitivity, character width, accent marks, kana character types.
75. What are all different types of collation sensitivity?
Different types of collation sensitivity are as follows
Case Sensitivity: A and a and B and b.
Kana Sensitivity: Japanese Kana characters.
Width Sensitivity: Single byte character and double byte character.
Accent Sensitivity.
Practical SQL Interview Questions:
In this part, we will see SQL practice questions which contain both complex SQL queries interview questions and basic SQL Interview Questions. Let’s see important SQL queries for interview
76. How to get unique records from a table?
By using DISTINCT keyword, we can get unique records from a table
Application Developer Interview Questions
77. What is the command used to fetch the first 5 characters of a string?
Some of the ways to fetch the first 5 characters of a string are as follows:
2 | SELECT RIGHT(EmpName,5)ASEmployeeName FROM Employee SELECT SUBSTRING(EmpName,1,5)ASEmployeeName FROM Employee |
78. How to add new Employee details in an Employee_Details table with the following details
Employee_Name: John, Salary: 5500, Age: 29?
INSERT into Employee_Details(Employee_Name,Salary,Age)VALUES(‘John’,5500,29); |
79. How to add a column ‘Salary’ to a table Employee_Details?
80. How to change a value of the field ‘Salary’ as 7500 for an Employee_Name ‘John’ in a table Employee_Details?
UPDATE Employee_Details set Salary=7500where Employee_Name=‘John’; |
81. Write an SQL Query to select all records from the table?
82. How To Get List of All Tables From A DataBase?
To view the tables available on a particular DataBase
2 4 | GO GO |
83. Define SQL Delete statement.
The SQL Delete statement is used to delete records from a table.
DELETE FROM table_name WHERE some_column=some_value; |
84. Write the command to remove all Players named Sachin from the Players table.
85. How to fetch values from TestTable1 that are not in TestTable2 without using NOT keyword?
2 4 6 8 | TestTable1 11 13 -------------- |
2 4 6 | TestTable2 11 -------------- |
By using the except
keyword
SELECT *FROM TestTable1 EXCEPT SELECT *FROM TestTable2; |
86. How to get each name only once from an employee table?
By using the DISTINCT keyword, we could get each name only once.
SELECT DISTINCT employee_name FROM employee_table; |
87. How to rename a column in the output of SQL query?
By using SQL AS keyword
88. What is the order of SQL SELECT?
Order of SQL SELECT statement is as follows
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY.
89. How to display the current date in SQL?
In SQL, there is a built-in function called GetDate() which helps to return the current date.
90. Write an SQL Query to find an Employee_Name whose Salary is equal or greater than 5000 from the below table Employee_Details.
2 4 6 | ----------------------------- Emma3500 Anne6500 |
Syntax:
SELECT Employee_Name FROM Employee_Details WHERE Salary>=5000; |
Output:
2 4 | ----------------------------- Anne6500 |
91. Write an SQL Query to find list of Employee_Name start with ‘E’ from the below table
2 4 6 | ----------------------------- Emma3500 Anne6500 |
Syntax:
SELECT *FROM Employee_Details WHERE Employee_Name like'E%'; |
Chase freedom to activate card. Output:
2 4 | ----------------------------- ----------------------------- |
92. Write SQL SELECT query that returns the FirstName and LastName from Employee_Details table.
93. How to rename a Table?
To rename Table Name & Column Name
2 | sp_rename'TableName.OldColumnName','NewColumnName' |
94. How to select all the even number records from a table?
To select all the even number records from a table:
2 |
95. How to select all the odd number records from a table?
To select all the odd number records from a table:
96. What is the SQL CASE statement?
SQL Case statement allows embedding an if-else like clause in the SELECT statement.
97. Can you display the result from the below table TestTable based on the criteria M,m as M and F, f as F and Null as N and g, k, I as U
2 4 6 8 10 | ------------ F m g i |
By using the below syntax we could achieve the output as required.
2 4 6 8 | case when Gender='g'then'U' when Gender='NULL'then'N' endasnewgender from TestTable GROUP BY Gender |
98. What will be the result of the query below?
select casewhen null=nullthen'True'else'False'endasResult; |
This query returns “False”. In the above question, we could see null = null is not the proper way to compare a null value. To compare a value with null, we use IS operator in SQL.
So the correct way is as follows
select casewhen nullisnullthen'True'else'False'endasResult; |
99. What will be the result of the query below?
select casewhen nullisnullthen'Queries In SQL Server'else'Queries In MySQL'endasResult; |
This query will returns “Queries In SQL Server”.
100. How do you update F as M and M as F from the below table TestTable?
2 4 6 | ------------------------ EmmaF AnneF |
By using the below syntax we could achieve the output as required.
UPDATE TestTable SET Gender=CASEGender WHEN'F'THEN'M'ELSE'F'END |
101. Describe SQL comments?
Single Line Comments: Single line comments start with two consecutive hyphens (–) and ended by the end of the line
Multi-Line Comments: Multi-line comments start with /* and end with */. Any text between /* and */ will be ignored.
102. What is the difference between NVL function, IFNULL function, and ISNULL function?
These three functions work in the same way. These functions are used to replace NULL value with another value. Oracle developers use NVL function, MySQL developers use IFNULL function and SQL Server developers use ISNULL function.
Assume, some of the values in a column are NULL.
If you run below statement, you will get result as NULL
Suppose any of the value in col3 is NULL then as I said your result will be NULL.
To overcome this we use NVL() function, IFNULL() function, ISNULL() Function.
ORACLE:
MySQL:
Also, you can use the COALESCE() function
SQL Server:
103. What is Database Testing?
It is AKA back-end testing or data testing.
Database testing involves in verifying the integrity of data in the front end with the data present in the back end. It validates the schema, database tables, columns, indexes, stored procedures, triggers, data duplication, orphan records, junk records. It involves in updating records in a database and verifying the same on the front end.
Interview Questions For Software Developer With Answers
104. What is the difference between GUI Testing and Database Testing?
- GUI Testing is AKA User Interface Testing or Front-end testing
Database Testing is AKA back-end testing or data testing. - GUI Testing deals with all the testable items that are open to the user to interaction such as Menus, Forms etc.
Database Testing deals with all the testable items that are generally hidden from the user. - The tester who is performing GUI Testing doesn’t need to know Structured Query Language
The tester who is performing Database Testing needs to know Structured Query Language - GUI Testing includes invalidating the text boxes, check boxes, buttons, drop-downs, forms etc., majorly the look and feel of the overall application
Database Testing involves in verifying the integrity of data in the front end with the data present in the back end. It validates the schema, database tables, columns, indexes, stored procedures, triggers, data duplication, orphan records, junk records. It involves in updating records in a database and verifying the same on the front end.
Final words Hope we have covered complex SQL Interview Questions and Answers for Experienced as well as Freshers. Bookmark this post “SQL Interview Questions And Answers for Experienced” for future reference. After reading this post “SQL Interview Questions”, if you find that we missed some important SQL Server Interview Questions, please comment below we would try to include those with answers.
Note: Most of my readers are asking me to write SQL Interview Questions for testers. If you are a Software QA, there is no point of learning separate SQL server query interview questions. This post covers everything for both Developers as well as Testers.
You May Like.
Also Read:
SUBSCRIBE TO GET FREE EBOOK AND REGULAR UPDATES ON SOFTWARE TESTING
Many software developers I have talked to absolutely dread job interviews. And I have seen job candidates absolutely flub a number of questions. Some are standard interview questions, but a developer will still need to answer them in a way that relates them to the job. Other questions are specific to the software development industry. Here are 10 job interview questions that come up in development interviews, with tips on how to address them.
1: Tell us about your current position
Employers want to know about what you are currently doing a lot more than they want to know about prior positions. The reason for this is simple: The world of software development moves so fast that what you did two or more years ago is interesting for background but probably has little bearing on their current work. When asking this question, the interviewer is trying to relate what you currently do to the position the company is offering, and you will want to answer with that in mind. For example, if the position you are applying for involves a lot of database programming, emphasize where in your current job you have worked with databases.
2: Programming challenges
Many employers will present you with some sort of programming challenge. These range from being asked to sketch out a piece of pseudo code that implements some business logic or being handed a piece of code and told to find the bugs to being put down in front of a computer and asked to code away. What they are usually looking for is not just a certain level of competency — they also want to see how you go about solving the problem. You can offer to narrate your thought process as you solve the problem. If they take you up on it, that will help them to learn what they are looking for. Or perhaps when you are done, you could walk the interviewer through how you solved it.
3: Do you have any examples of your work?
Employers love to be able to look at real-world examples of your work. Unfortunately, this is rarely possible. The truth is, in most circumstances, your work is the property of your employer and you can't be taking it outside of the building without permission. And it would be unusual to have a boss say, 'Sure, go grab a couple of your best apps from source control to take on the job interview!' Instead of being unable to provide any samples, contribute to an open source project or work on an application at home that is sophisticated enough to let your skills shine. Then you will have something that you can show the interviewer and also be able to demonstrate an ability to work on your own and manage your own time, too. These side projects can often serve as a great talking point in the interview.
4: Brainteasers
Apart from asking you to demonstrate some programming abilities in the interview, some employers may give you a variety of brainteasers. Some people are really good programmers and stink at these, but the idea is to test your overall problem-solving skills. Luckily, you can prepare for these a little bit by picking up a few brainteaser books (usually only a dollar or two) at a book store or supermarket and doing a few every day. Most of these brainteasers follow a similar format, so by practicing, you will understand how to approach the most common types. There are also a few standard ones that come up on a regular basis, such as the one where you need to get a group of people across a river with a boat of limited capacity.
5: Do you have a security clearance?
Depending upon the job, a security clearance may be required. Employers prefer hiring people with one already because it simplifies things. It would be a big hassle to hire someone and then discover that they can't get the needed clearance to do the job. If you have a clearance, make sure that it is up to date. It's also a good item to list on a resume.
If you do not have a security clearance, ask before you come in for the interview about any security requirements for the job and research whether you are eligible for any security clearances needed. This way, when asked, you can answer with something like, 'No, I do not have that clearance, but I have looked into it and I can obtain one if needed.'
6: Background check and criminal history information
Information about criminal history and other background check items typically will not come up in an interview with a hiring manager, but they will often come up in an interview with HR or a recruiter (especially the recruiters). They do not want details, for the most part, but they want to know whether it will be a waste of time interviewing you. Obviously, it is great to have a squeaky clean record, but there are plenty of good job candidates who don't. You will need to be honest here, because things show up on the background check anyway. If what you say does not match the check, they will feel that you lied to them. At the same time, limit your sharing to the minimum. You can start with something like, 'I have a misdemeanor conviction from three years ago' and take it from there.
7: What is your experience level with XYZ?
When interviewers ask about your experience level with a technology, they really want to get a feel for what you have been doing with it, not how long you have been doing it. For example, if they are asking about SQL, is it important to them that you have been writing statements no more complex than, 'SELECT id, name, city FROM people WHERE state = 'NY' for 10 years? Not really. Performing complex data transformations, correlated subqueries, etc., for six months will be much more impressive. When talking about your experience level, emphasize the kinds of challenges you solved with those technologies and the unique aspects of the technologies you used to solve the problems.
8: What's the hardest challenge you have had to overcome — and how did you approach it?
This is a stock interview question, but it has some special pitfalls for the programmer. One of the failures I've seen in interviews is that candidates do not properly set the context of their answer. I have faced some challenges that at that point in my career were difficult but that later on were trivial. If I brought them up in an interview without explaining my experience level when they arose, it would put me in a bad light. The interviewer would be thinking, 'Why would someone with his experience struggle with this?' So when you answer, give a short (one sentence) scene setup. Also, put your focus on the problem-solving steps you took, not the technical details. No one really cares if the problem turned out to be that the variable was one character shorter than the data going into it; they want to know how you did the research to discover it.
9: Describe your programming habits
There are a number of variations on this question, some of which just ask about things such as:
- Source control
- Testing
- Variable/file/class/whatever naming
- Application architecture decisions
Some things we do by habit are not flattering when we answer these questions, but it is because of circumstances outside of your control. For example, if your current employer does not have a source control system, do not say, 'I do not use source control' because it makes you look awful! Instead, an answer such as, 'My current employer does not have a source control system, but I have used TFS at a previous employer, and I use Mercurial at home for personal projects' will be much better.
Other times, we simply have bad habits; in those cases, it is better to recognize them and show that you are trying to change them. You could say something like, 'I tend to not write as many unit tests as I should, but I have been working hard to ensure greater code coverage.' Of course, don't lie about this. But employers like to find people with enough self-awareness to see and correct their flaws, and the honesty to be able to discuss them.
10: Tell us a little bit about yourself
Often, job candidates go way off the deep end on this question, talking about things they do not need to be discussing in a job interview, personal stories and relationships, and so on. Or worse, they bring up things that present them in an unflattering light. What the interviewer is really looking to learn is how your personality relates to the job of software development. For example, if you enjoy restoring antique furniture, you could point out that it requires a lot of patience, eye for detail, research, and so on. Of course, you will want to talk about your personality traits as well. Unusual experiences or education can be brought up here, too. What you definitely do not want to do is talk too long. Try to make it a back-and-forth conversation, but if it isn't, limit your time to a few minutes and don't trip all over yourself trying to cram in every last detail.