SQL related questions
SQL Interview Questions | Solving Database Problem
Question
SQL Interview Questions | PARTITION key
Question
SQL Interview Questions | Get the appropriate result
Question
Name
Gender
X
MALE
XY
FEMALE
XYZ
FEMALE
Y
MALE
YZ
FEMALE
YZX
MALE
Z
FEMALE
The given table is a part of a larger table consisting data of people present in a meeting.
This data needs to be sorted and the output should be like this,
MALE
FEMALE
3
4
Write the query accordingly.
in progress
0
SQL
55 years
1 Answer
1312 views
Great Grand Master
SQL Interview Questions | Alternative of TOP Clause
Question
What is alternative for TOP clause in SQL? Anyone having knowledge of SQL is aware about TOP clause, but only a person with deep understanding can answer this question.
(Hint-You might discuss various alternatives to get the same work done)
in progress
0
SQL
55 years
2 Answers
1167 views
Great Grand Master
SQL Interview Questions | Output of Functions
Question
SQL Interview Questions | Remove duplicate entries
Question
empid
empname
managerid
deptid
Salary
1
Emp1
0
1
6000
2
Emp2
0
5
6000
3
Emp3
1
1
2000
13
Emp13
2
5
2000
11
Emp11
2
1
2000
9
Emp9
1
5
3000
8
Emp8
3
1
3500
7
Emp7
2
5
NULL
3
Emp3
1
1
2000
In the same table, some duplicate records might be present by mistake. Sort out a way to locate them and find a way to delete them.
in progress
2
SQL
55 years
4 Answers
1857 views
Great Grand Master
SQL Interview Questions | Employees with same salary
Question
empid
empname
managerid
deptid
Salary
1
Emp1
0
1
6000
2
Emp2
0
5
6000
3
Emp3
1
1
2000
13
Emp13
2
5
2000
11
Emp11
2
1
2000
9
Emp9
1
5
3000
8
Emp8
3
1
3500
7
Emp7
2
5
NULL
3
Emp3
1
1
2000
Can you get the list of employees with the same salary? You just need to focus on a particular section of the table.
(Hint- Try to be specific)
in progress
0
SQL
55 years
5 Answers
2099 views
Great Grand Master
SQL Interview Questions | Collect employee details
Question
empid
empname
managerid
deptid
Salary
1
Emp1
0
1
6000
2
Emp2
0
5
6000
3
Emp3
1
1
2000
13
Emp13
2
5
2000
11
Emp11
2
1
2000
9
Emp9
1
5
3000
8
Emp8
3
1
3500
7
Emp7
2
5
NULL
3
Emp3
1
1
2000
Can you get employee details whose department id is not valid or department id not present in the department table?
in progress
0
SQL
55 years
4 Answers
1068 views
Great Grand Master
SQL Interview Questions | Find the manager name
Question
Refer to the following table and answer the questions related to it.
empid
empname
managerid
deptid
Salary
1
Emp1
0
1
6000
2
Emp2
0
5
6000
3
Emp3
1
1
2000
13
Emp13
2
5
2000
11
Emp11
2
1
2000
9
Emp9
1
5
3000
8
Emp8
3
1
3500
7
Emp7
2
5
NULL
3
Emp3
1
1
2000
The Employee and manager id are in the same table. Is it possible to get the manager names for the corresponding employee? How will you proceed for the same?
in progress
1
SQL
55 years
3 Answers
1767 views
Great Grand Master
SQL Interview Questions | Verify the Table
Question
The following table consists of some data in the 7 rows
10/12
1a/90
23/11
2442
22/3c
11/43
dd/ss
You can clearly see that the table is not uniform. In reality, this table should consist the data in the form of NN/NN.
Verify that the first and last two characters ...
in progress
1
SQL
55 years
1 Answer
1414 views
Great Grand Master