ÇóSQL¡«¡«¡«¡«¡«
×ÜÊý±í
×ֶΠnum,freq
numÊÇËùÊôÆÚµÄ×ÜÊý£¬freqÊǼǼ¸ÃÊýÖµËùÊôÄÄÒ»ÆÚµÄ
ÇøÓò±í
×ֶΠarea_name,tot,freq
ÇøÓòÃû³Æ£¬¸ÃÇøÓòµÄ×ÜÊý£¬ËùÊôÆÚ
Á½ÕÅ±í¿¿freq¹ØÁª£¬ÇÒ²»ÊÇ×ÔÔö×ֶΣ¬²»ÊÇÖ÷¼ü
¼ÙÉè À´ÁËÒ»ÅúÐÅÏ¢£¬ÊǵÚ20ÆÚ Õã½ÊýÁ¿ÊÇ200 ×ÜÊýÊÇ2000
ÉÏÆÚ ¼´19ÆÚ Õã½ÊýÁ¿ÊÇ150 ×ÜÊý1600
¼ÆËã
(20ÆÚµÄÕã½µÄ200 / 2000) - (19ÆÚµÄÕã½µÄ150 / 1600) =ËùµÃÖµ X
²¢¶ÔX½á¹û¼¯ ·Ö±ðÈ¡ÕýÐò µ¹Ðò¸÷10Ìõ
ÒÀÕÕÒÔÉϼÙÉ裬SQL½á¹ûÊÇ
ÇøÓòÃû³Æ--------×îÐÂÒ»ÆÚ¸ÃÇøÓòµÄÊýÁ¿¼´µÚ20ÆÚ--------ËùµÃÖµX
Õã½----------------200-----------------------------X
ÉϺ£----------------180-----------------------------X
¼ÙÉèÖÐÊÇÖ»ÓÐÒ»¸öÇøÓò Õã½£¬Êµ¼ÊÿÆÚÒ»ÓкܶàÇøÓò£¬ÊýÁ¿Î´Öª¡£µ«Ã¿Æڿ϶¨ÓÐÏàͬµÄÇøÓò£¬×öÕâЩÏàͬÇøÓòµÄ¼ÆËã¡£
½«Á½±íµÄ¼Ç¼¼°ÒªÇó½á¹û³öÀ´¿´¿´
×ÜÊý±íÊÇ
num---------------------------freq
600---------------------------2
860---------------------------3
1500--------------------------19
2000--------------------------20
ÇøÓò±íÊÇ
area_name------------tot------------freq
Õã½-----------------200-------------2
¹ã¶«-----------------100-------------2
ɽÎ÷-----------------101-------------2
Õã½-----------------150-------------19
¹ã¶«-----------------100-------------19
ɽÎ÷-----------------101-----
Ïà¹ØÎÊ´ð£º
´ó¼ÒºÃ£¬ÇëÎÊÔÚ±íMÖÐÓÐ×ֶΣºa b c d e
ÎÒÏë²é³öÆäÖÐÂú×ãÏÂÃæÈÎÒâÒ»ÏîµÄÊý¾Ý£¬1.×Ö¶Îa µÄÖµ²»ÊÇ ¡®Êé»ò±Ê»ò±¾¡¯ÖÐÈÎÒ»£¬2.aΪÊéµÄʱºò×Ö¶Îb,cÊÇ¿Õ;3.µ±aֵΪ±ÊµÄʱºòdÊÇ¿Õ;4.µ±aΪ±¾µÄʱºòb,d,e¶¼ÊÇ¿Õ;5.È ......
ÓÐʱºòÔÚÊý¾ÝÖвéѯÊý¾ÝµÄʱºò¿¼ÂÇÐÔÄÜÎÊÌ⣬»á½«¸´ÔÓÓï¾ä²ð·Ö»ò½èÓÃÁÙʱ±íÀ´¶à´Î²éѯ×îÖյõ½ÏëÒªµÄÊý¾Ý£¬ÏÖÔÚ½«ÕâЩ²éѯÄÚÈÝ×ö³É±¨±í£¬ÐèҪд¸öÓï¾äÒ»ÆøºÇ³É¡£
ÎÒÏëÎʵÄSQLÊÇ·ñ¿ÉÒÔÔÚ²éѯÓï¾äÒ»½áÊøºó£¬ÔÙ×Ô¶¯Ô ......
ÇëÎʸßÊÖ2005µÄ±ê×¼°æÊÇ·ñ¿ÉÒÔÔ¶³ÌÁ¬½Ó£¬Èç¹û¿ÉÒÔ£¬Ó¦¸ÃÔõôÉèÖã¬ÎÒ°´ÕÕ Express°æµÄÉèÖÃÁË£¬²»ÐС£¡£
¿ÉÒÔ
¿ÉÒÔ
²»ÖªµÀÄãÏëÔõôԶ³ÌÁ´½Ó
Ö±½ÓÔÚ¿Í»§¶ËµÇ¼¡£¡£
°´ÕÕ5Â¥µÄ×öÁË È»ºóÔÚ¿Í»§¶ËдÁ¬½Ó× ......
ÇóÔÚһͬһ¸ö±íÀïÃæ
a b
10 7
(a-b)=a
ÔÚÔÀ´µÄ±íA¶Î¸üÐÂΪ3
ÏÈлл¸÷λÁË,°ï¸öæ
SQL code:
update a set a=a-b
SQL code:
-->Title:Generating test data
-->Author ......