SQL DBA Interview question and answer
<!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:ËÎÌå;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin-top:0cm;
margin-right:0cm;
margin-bottom:10.0pt;
margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:SimSun;
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:SimSun;
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
.MsoPapDefault
{mso-style-type:export-only;
margin-bottom:10.0pt;
Ïà¹ØÎĵµ£º
Join²Ù×÷·û
ÊÊÓó¡¾°£ºÔÚÎÒÃÇ±í¹ØÏµÖÐÓÐÒ»¶ÔÒ»¹ØÏµ£¬Ò»¶Ô¶à¹ØÏµ£¬¶à¶Ô¶à¹ØÏµµÈ¡£¶Ô¸÷¸ö±íÖ®¼äµÄ¹ØÏµ£¬¾ÍÓÃÕâЩʵÏÖ¶Ô¶à¸ö±íµÄ²Ù×÷¡£
˵Ã÷£ºÔÚJoin²Ù×÷ÖУ¬·Ö±ðΪJoin(Join²éѯ), SelectMany(SelectÒ»¶Ô¶àÑ¡Ôñ)ºÍGroupJoin(·Ö×éJoin²éѯ)¡£
¸ÃÀ©Õ¹·½·¨¶ÔÁ½¸öÐòÁÐÖмüÆ¥ÅäµÄÔªËØ½øÐÐinner join²Ù×÷
SelectMany
˵Ã÷£ºÎÒà ......
# MySQL-Front 5.1 (Build 4.2)
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */;
/*!40101 SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES */;
/*!40103 SET SQL_NOTES='ON' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS */ ......
»Ö¸´Ä£Ê½ÊÇÊý¾Ý¿âµÄÒ»ÖÖÌØÐÔ,Ëü¿ØÖÆ×ÅÊý¾Ý¿â±¸·ÝºÍ»¹ÔµÄ»ù±¾ÐÐΪ.
sql server ÌṩÁËÈýÖÖ»Ö¸´Ä£Ê½,ËûÃǾö¶¨ÁËÓжàÉÙºÍʲôÑùµÄÊý¾Ý¿ÉÒÔ±»±¸·ÝÏÂÀ´.
1.¼òµ¥»Ö¸´Ä£Ê½
Ö÷ÒªÓ¦ÓÃÓÚСÐÍÊý¾Ý¿âºÍ²»¾³£¸Ä±äµÄÊý¾Ý
2.ÍêÕû»Ö¸´Ä£Ê½
¿ÉÒÔÔÚ×î´ó·¶Î§ÄÚ·ÀÖ¹³öÏÖ¹ÊÕÏʱ¶ªÊ§Êý¾Ý,Ëü°üÀ¨Êý¾Ý¿â±¸·ÝºÍʳÎïÈÕÖ¾±¸·Ý,²¢Ìá¹ ......
PL/SQL-FOR UPDATE Óë FOR UPDATE OFµÄÇø±ð
url:http://hi.baidu.com/1413/blog/item/a521251f7e5993c4a686696b.html
Êý¾Ý¿â oracle for update of ºÍ for updateÇø±ð
select * from TTable1 for update Ëø¶¨±íµÄËùÓÐÐУ¬Ö»ÄܶÁ²»ÄÜд
2 select * from TTable1 wher ......