Photo of database interview questions to practice

58 database interview questions from top tech companies to practice

Hi, I’m Olga! I have years of experience in data science, most recently at eBay. Now I work as an industry mentor at Pathrise, helping data scientists land great jobs through technical workshops and 1-on-1s. Check out this list of database interview questions to practice.

Knowledge of databases is an extremely important element of software engineering and data science. Most people learn SQL (Structured Query Language) as it is the standard programming language used to communicate with databases, but there are additional database interview questions that can be asked.

We have worked with many data scientists and software engineers with data backgrounds on their job search, including spending a lot of time on technical interview preparation. One of our best suggestions is to practice the questions you are likely to be asked, so we created this list of 58 database interview questions from real tech companies. We also included some tips to help you be confident and successful in your sessions.

Database interview questions

  1. Infosys question – What is a database schema?
  2. Oracle question – What is RDBMS?
  3. Accenture question – Differentiate unique key, foreign key and primary key.
  4. ADP question – What is a clustered index?
  5. Microsoft question – What are SQL joins? How to use them to fetch data from multiple tables?
  6. Infosys question – What are SQL triggers?
  7. Oracle question – Describe different types of general functions used in SQL.
  8. OpenText question – What is the difference between COUNT (*), COUNT (expression), COUNT (distinct expression)?
  9. Dell question – What is a subquery in SQL? What are the different types of a subquery?
  10. Cerner question – What is the difference between ANY and ALL operators?
  11. Oracle question – What is a MERGE statement?
  12. Accenture question – What is an index and what is its use in SQL?
  13. DocuSign question – What is the difference between a clustered and non-clustered index?
  14. What is a parser?
  15. Which databases are part of SQL server default installation? Explain the usage of each.
  16. Infosys question – What are all the db objects that can be found in an MSDB database of a SQL server instance?
  17. Accenture question – What is one of the first things you would do to increase performance of a query?
  18. Microsoft question – What is a query execution plan? How does it help optimize or tune a database driven application?
  19. ADP question – Which is better in performance – CONSTRAINT or TRIGGER over a column, which restricts say, an input of particular value in a column of a table?
  20. OpenText question – What are mdf, ndf, ldf files and how do you see the data in those files?
  21. Accenture question – Differentiate between functions and stored procedures.
  22. Oracle question – Differentiate between log shipping and database mirroring.
  23. Accenture question – Can we do database mirroring when filestream is enabled on database?
  24. ADP question – What is normalization?
  25. Dell question – What is self-join?

More database interview questions

  1. Differentiate between self-join and equi-join in SQL.
  2. Cerner question – What is the difference between TRUNCATE and DROP statements? What about DELETE and TRUNCATE?
  3. ADP question – What are aggregate and scalar functions?
  4. DocuSign question – Which operator is used in a query for pattern matching?
  5. ADP question – You are given an employee table, with the columns id, name, sal and dob. Query to select emp names of all highest salaries (there are 4-5 people having the same salary which happens to be the highest).
  6. Microsoft question – How do you join 3 tables in one single SQL query?
  7. OpenText question – Write a SQL query to find all table names in a database.
  8. Accenture question – How do you find the duplicate rows in a table on a database?
  9. Oracle question – What is the difference between a WHERE and HAVING clause in SQL?
  10. Infosys question – Differentiate between the primary and candidate key in table?
  11. DocuSign question – What is the fastest way to empty a table?
  12. ADP question – What are the different types of joins possible in a SQL server? 
  13. What is an identity column in a SQL server?
  14. Microsoft question – How do you return an identity value from a table? How do you return an identity value from a table with a trigger?
  15. Cerner question – How many bytes can you fit in a row? Explain your reasoning.
  16. How many clustered indexes per table are allowed?
  17. Dell question – How many nonclustered indexes can you create per table?
  18. OpenText question – What is the difference between varchar and nvarchar data type in a SQL server?
  19. DocuSign question – What is an execution plan?
  20. Which one is fastest and slowest among index scan, index seek, and table scan?

Database interview questions continued

  1. How do you return a value from a proc? How do you return a varchar value from a proc?
  2. Infosys question – If I have a column that will only have values between 1 and 250, what data type should I use?
  3. Microsoft question – How do you enforce that only values between 1 and 10 are allowed in a column?
  4. Which date format is the only safe one to use when passing dates as strings?
  5. Cerner question – Can you name the 4 isolation levels in Microsoft SQL server? 
  6. DocuSign question – How would you select all last names that start with S?
  7. Oracle question – How would you select all rows where the date is yesterday’s date?
  8. Dell question – How do you find the Nth highest salary in a table?
  9. ADP question – How do you test for nulls in SQL query?
  10. Accenture question – What are some differences between isnull and coalesce in a SQL server?
  11. Microsoft question – What is the difference between the cast, convert, and parse function in a SQL server?
  12. OpenText question – What is the difference between a local and global temporary table?
  13. Dell question – What is the difference between GETDATE, SYSDATETIME, and GETUTCDATE functions in a SQL server?
  14. DocuSign question – If you create a local temp table and then call a proc, is the temp table available inside the proc?
  15. Infosys question – What is referential integrity in a relational database?
  16. How do you compare dates in a SQL server? Which operator will you use?
  17. Microsoft question – How do you remove duplicate rows from a table in SQL?
  18. Cerner question – What data type should you use to store monetary values?
  19. ADP question – What is cascade delete in SQL server?
  20. Oracle question – What is the difference between close and deallocate cursor in SQL?

Final database interview questions

  1. Dell question – What is the difference between row_number, rank, and dense_rank in SQL Server?
  2. Accenture question – What is a SQL injection?
  3. OpenText question – What are the differences between PRIMARY KEY and UNIQUE constraints?
  4. Infosys question – How do you ensure that SQL server will use an index?
  5. Microsoft question – What is the difference between union and union all?

How to be successful in your interviews

Photo of database interview questions

After you practice the technical questions, make sure you prepare yourself for the way you will act in your interviews. Coming up with a game plan for yourself and feeling confident in your hard and soft skills will make you more successful. Use these tips to help you get ready for your interviews.

Start with clarifying questions

You might feel the time limit means that you need to jump right into solving the problem, but actually, you should spend the first 15-45 seconds reading the question fully and coming up with clarifying questions of your own. Make sure that you and the interviewer are on the same page before you start working. Questions like, “Are repetitions allowed?” or “Do you want to return permutations or combinations?” can be good starts.

Tell the interviewer what you know

As you work through the question, give tidbits of information to your interviewer proactively, so they get a sense of your knowledge without having to ask you directly. Not only is this helpful in their overall perception of you as a candidate, but it reduces the time where you are sitting in silence as you think or code.

Give context to your work

You should also be providing context with each step you take, so that they can understand what is going through your mind. Give them a sense of your mindset and why you are making the decisions you are making. This is especially important if you make a mistake, because they will understand where you went wrong.

Ask for help the right way

If you are unsure how to continue, you can ask your interviewer for guidance without using the word “hint.” Instead, make a collaborative statement to the interviewer like “my assumptions are X and Y, I’m thinking of doing Z. But I’m struggling with solving [problem].” You can also try asking questions or making comments like,

  • I was wondering if you had any thoughts.
  • Do you think I’m going down the right direction?
  • Do you think my assumptions are incorrect?

With these questions & tips in your back pocket, you should be more than prepared for your next technical onsite interview. Feel like you need more help? Check out these resources to practice more software engineering interview questions.

Pathrise is a career accelerator that works with students and professionals 1-on-1 so they can land their dream job in tech. With these tips and guidance, fellows have seen their interview scores double.

If you want to work with any of our mentors 1-on-1 to get help with your software engineer interviews or with any other aspect of the job search, become a Pathrise fellow.

Apply today

Pathrise logo
Alex MacPherson

Hi I'm Alex! Since graduating from UC Berkeley in 2019, I have worked on the growth team for Pathrise helping job seekers hone their skills to land their dream role through curated content on interview prep, resume building and more.

Leave a Reply

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