Home > database >  Today to interview the dba have two problem won't do
Today to interview the dba have two problem won't do

Time:09-15

have bosses give a correct answer under reference

CodePudding user response:

The first question:
SELECT
A. china_name,
COUNT (b.o pr_state_id) AS KXJJSL
The FROM
Spc_room A,
Rme_rack b
WHERE
='170001' b.o pr_state_id
AND a. is_supportide=1
AND p. osit_id=a. room_id
GROUP BY
A. china_name
The second question:
SELECT
*
The FROM
Rme_port
WHERE
Super_res_id IN (
SELECT
Eqp_id
The FROM
Rme_eqp
WHERE
Posit_id IN (
SELECT
Room_id
The FROM
Spc_room
WHERE
A. is_supportide=1
)
)

CodePudding user response:

1 leakage conditions, should be like this:

CodePudding user response:

refer to the second floor wildwolv response:
1 missed a condition, should be like this:
thank you

CodePudding user response:

 
Question - 1
The SELECT a.c hina_name, COUNT (b.o pr_state_id) AS CNT
The FROM spc_room AS a
INNER JOIN rme_rack AS b ON a.r oom_id=p. osit_id AND b.o pr_state_id='170001'
WHERE Anderson ssupportidc=1
HAVING a COUNT (b.o pr_state_id) & gt; 1000

- question 2
- in
B. SELECT * FROM rme_eqp AS a
INNER JOIN rem_port AS b ON a.e qp_id=b.s uper_res_id
WHERE Amy polumbo osid_id IN (
The SELECT room_id FROM spc_room
WHERE issupportidc=1
)
- the exists
B. SELECT * FROM rme_eqp AS a
INNER JOIN rem_port AS b ON a.e qp_id=b.s uper_res_id
WHERE the exists (
The SELECT room_id FROM spc_room AS c
WHERE issupportidc=1 AND Amy polumbo osit_id=c.r oom_id
)

CodePudding user response:

 
The SELECT a.c hina_name, COUNT (b.o pr_state_id) AS CNT
The FROM spc_room AS a
INNER JOIN rme_rack AS b ON a.r oom_id=p. osit_id AND b.o pr_state_id='170001'
WHERE Anderson ssupportidc=1
GROUP BY a.c hina_name
HAVING a COUNT (b.o pr_state_id) & gt; 1000

Less a grouping conditions

CodePudding user response:

No hiring plan, but still send a lot of ads on the Internet,
Encountered in the project, not solve the problem, as the interview questions,
  • Related