Write an SQL Query find number of employees whose DOB is between 01/07/1965 to 31/12/1975. Collect the data separately for different gender.
Use column name as sex, DOB table name Employees.
(Hint- Imagine a hypothetical data)
You are a part of a MNC and someone complains that their app is running slow because of what they think is a "database problem". How do you go about investigating the slowness and helping them to improve their queries?
(Hint- You ...
How to go about picking a good PARTITION key for a big table, and what are some of the "gotchas" of a badly chosen PARTITION key. It might seem to be simple, but you need to give a good explanation ...
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.
Could you tell output or result of following SQL statements?
(Hint- In some cases, there may be an error. So, try to locate them and answer accordingly)
select 5
select ‘5’
select count (‘5’)
select count (5)
select count (*)
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.
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?
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 ...