什么是专家SQL知识? [英] What is expert SQL knowledge?

查看:45
本文介绍了什么是专家SQL知识?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的公司和我采访的很多人做了很多招聘

说他们是SQL查询的专家,但当我给他们一些东西时

简单地超出了典型的SELECT类型的查询,它们会窒息。


例如我有一个如下表:


PK_ID - 主键

PARENT_ID - 同一个表中另一行的FK


这基本上是树结构。我会要求受访者写一个查询,它将返回所有包含2个直接子节点的行。没有

一个人知道怎么做。


我没有得到它。我已经做了一些令人困惑的疑问,他们比这更复杂。


我问得太多了吗?

-

* Don Vaillancourt

软件开发总监

*

* WEB IMPACT INC。*

手机:416-815-2000转。 245

传真:416-815-2001

电子邮件:执行** @ web- impact.com < mailto:do ** @ webimpact.com>

web: http://www.web-impact.com


/此电子邮件仅供收件人使用

并包含可能保密和/或
版权的信息。如果您不是预定的收件人请

通过回复电子邮件通知发件人并立即删除

此电子邮件。除预定收件人以外的任何人使用,披露或复制此电子邮件

是严格禁止的b $ b。没有人表示此电子邮件或

任何附件都没有病毒。病毒扫描建议为
,并且是收件人的责任。

/

I do a lot of hiring for my company and a lot of the people I interview
say that they are experts at SQL queries, but when I give them something
simple just beyond the typical SELECT type of queries, they choke.

For example I have a table that looks like this:

PK_ID - primary key
PARENT_ID - a FK to another row in the same table

This essentially is a tree structure. I will ask interviewees to write
a query that will return all the rows that have 2 direct children. No
one knows how to do this.

I don''t get it. I have done queries which boggle the mind and they are
far more complex than this.

Am I asking too much?
--
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: do**@web-impact.com <mailto:do**@webimpact.com>
web: http://www.web-impact.com

/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/

推荐答案

我不知道你正在面试的是哪个杠杆程序员,但是我在这里有一个不列颠哥伦比亚省的BC,并且已经在该领域工作了大约4年


我的答案是肯定的,没有


不,这是一个简单的查询


选择PK_ID

来自< ;表格名称>

其中PK_ID在

中(

从< table name> group中选择Parent_ID by Parent_ID具有count(*)

= 2




是的,如果我在求职面试中感到紧张,我可能会通过测试


但我相信你的决定不仅仅取决于这个标准。

祝你好运

Rick

I don''t know what lever programmer you are interviewing for but I
have a BC in IS and have been working in the field for about 4yr

My answer would be yes and no

No, it is a simple query

Select PK_ID
from <table name>
where PK_ID in
(
select Parent_ID from <table name> group by Parent_ID having count(*)
= 2
)

Yes, if I was nervous in a job interview I would probably fail the test

But I''m sure your not basing your decision solely on this criteria.
Good luck
Rick


对于采访,我个人喜欢书面测试。我认为这是对sql掌握的更加客观衡量。


???

选择c。*

来自tbl c

加入



选择a.pk_id

来自tbl a

加入tbl b

a.parent_id = b.pk_id

group by a.pk_id

有计数( *)= 2

)d

on c.pk_id = d.pk_id

For interviews, I personally like written tests. I think it is a more
objective measure of sql mastery.

???
select c.*
from tbl c
join
(
select a.pk_id
from tbl a
join tbl b
on a.parent_id = b.pk_id
group by a.pk_id
having count(*)=2
) d
on c.pk_id = d.pk_id


I我的决定不仅仅基于此。只要他们表现出很大的努力并且非常接近于解决它,那么我会认为那很好。


但我有程序员告诉我他们是专家,但从来没有想过使用子查询或聚合函数的
。然而,在基于SQL的书面测试的其他部分中做得很好。


我甚至有一个程序员过度编程了他的查询。 br $> b $ b -

* Don Vaillancourt

软件开发总监

*

* WEB IMPACT INC。*

电话:416-815-2000转。 245

传真:416-815-2001

电子邮件:执行** @ web- impact.com < mailto:do ** @ webimpact.com>

web: http://www.web-impact.com


/此电子邮件仅供收件人使用

并包含可能保密和/或
版权的信息。如果您不是预定的收件人请

通过回复电子邮件通知发件人并立即删除

此电子邮件。除预定收件人以外的任何人使用,披露或复制此电子邮件

是严格禁止的b $ b。没有人表示此电子邮件或

任何附件都没有病毒。病毒扫描建议使用
,由接收方负责。

/
I am not not basing my decision only on this. As long as they show an
effort and are very close to solving it, then I would consider that good.

But I have had programmers telling me they were experts, yet never think
of using subqueries or aggregate functions. Yet, do great in other
parts of the written test which are not SQL based.

I even had one programmer who over-programmed his query.
--
* Don Vaillancourt
Director of Software Development
*
*WEB IMPACT INC.*
phone: 416-815-2000 ext. 245
fax: 416-815-2001
email: do**@web-impact.com <mailto:do**@webimpact.com>
web: http://www.web-impact.com

/ This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
/


这篇关于什么是专家SQL知识?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆