Sql Interview Questions | Glassdoor

Sql Interview Questions

112

interview questions shared by candidates

Sql Interview Questions

Sort: RelevancePopular Date

Write an efficient stored procedure to allocate unique integer ids.

1 Answer

CREATEPROCEDURE [dbo].[AllocateUniqueIntIds] AS BEGIN SelectABS(CAST(CAST(NEWID()ASVARBINARY(5))ASBigint))as UniqueIntegerId END Go /* Test the store proc */ Exec [dbo].[AllocateUniqueIntIds] //Not sure if this is the correct answer

Explain the difference between an inner join and outer join.

1 Answer

Given a table that has parent's id and children id, write a query that return grandparents and grandchildrens

1 Answer

Write a SQL command that returns users' order history and the total cost of each order including shipping. There are 3 tables: users table, orders table, order details table.

3 Answers

Write a function that takes in two sorted lists and outputs a sorted list that is their union.

9 Answers

SQL Two tables each have one column with a field called 'ID' write SQL to extract online the ID's in table one that are not in table two

4 Answers

You have gained access to a Web server with a SQL backend. What SQL command could be used to gain access to the SQL database's underlying Operating System?

2 Answers

If you have two SQL database tables that are not joined together, how would you create another table to join them.

3 Answers

I was asked about how to avoid data corruption in relational databases. (very broadly, not specifics)

2 Answers

question focused on sql...

1 Answer
110 of 112 Interview Questions