Sql Interview Questions | Glassdoor

Sql Interview Questions

6,138

interview questions shared by candidates

Sql Interview Questions

Sort: RelevancePopular Date

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

4 Answers

Relational schema - p_name and c_name make a composite primary key relation {p_name varchar, c_name varchar} select t1.Grandchild, t2.Grandparent from (select c_name as Grandchild, p_name from relation where p_name in (select distinct(r.p_name) from relation r join relation t on r.p_name = t.c_name)) as t1 inner join (select p_name as Grandparent, c_name from relation where c_name in (select distinct(r.p_name) from relation r join relation t on r.p_name = t.c_name)) as t2 on t1.p_name=t2.c_name order by t1.Grandchild;

select t1.Grandchild as Grandchild ,t2.Grandparent as Grandparent from (select distinct(r.c_name) as Grandchild,r.p_name as parent from relation r join relation t on r.p_name = t.c_name) t1 ,(select distinct(r.p_name) as Grandparent,r.c_name as parent from relation r join relation t on r.c_name = t.p_name) t2 where t1.parent=t2.parent;

select a.p_name as grandparent, b.c_name as grandchild from relation a join relation b on a.p_name=b.c_name

Describe the different parts of an SQL statement

2 Answers

That is a SQL buffer Overflow

1 Answer

Explain the difference between an inner join and outer join.

1 Answer

Design the DB and server system where multiple users can enter calendar events, including alerts for those events.

1 Answer

In a typical sql query, what would happen when there are no bind variables? What happens when you put bind variables, does it help the performance or not? If so, how?

1 Answer

What experience do you have with Microsoft SCCM? What Experience do you have using SNOW SAM software? What experience do you possess leading/managing a service desk?

1 Answer

Write an efficient stored procedure to allocate unique integer ids.

1 Answer

Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.

1 Answer

I was asked about XSS, SQL Injection, Tools I have used for pen testing.

1 Answer
110 of 6,138 Interview Questions