ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2024/12/23 4:21:34ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£
6£®select ѧºÅ,ÐÕÃû,¿Î³ÌºÅ,³É¼¨ from ѧÉú s,Ñ¡Ð޳ɼ¨ sc Where s.ѧºÅ=sc.ѧºÅ and¿Î³ÌºÅ=¡¯kc02¡¯
and ³É¼¨=(select max(³É¼¨) from Ñ¡Ð޳ɼ¨
where¿Î³ÌºÅ=¡¯kc02¡¯)
»ò:
Select top 1 ѧºÅ,ÐÕÃû,¿Î³ÌºÅ,³É¼¨ from ѧÉú s,Ñ¡Ð޳ɼ¨ sc Where s.ѧºÅ=sc.ѧºÅ and¿Î³ÌºÅ=¡¯kc02¡¯
order by ³É¼¨ desc
7£®Select max(³É¼¨) as ×î¸ß·Ö,min(³É¼¨) as ×îµÍ·Ö, avg(³É¼¨) as ƽ¾ù·Ö from Ñ¡Ð޳ɼ¨
8£®Select ¿Î³ÌºÅ,max(³É¼¨) as ×î¸ß·Ö, min(³É¼¨) as ×îµÍ·Ö,avg(³É¼¨) as ƽ¾ù·Ö from Ñ¡Ð޳ɼ¨ group by ¿Î³ÌºÅ
9£®select count(*) as ¿ª¿ÎÃÅÊý from ¿Î³Ì 10£®select * from ѧÉú
where ѧºÅ in(select ѧºÅ from Ñ¡Ð޳ɼ¨) 11£®Update books set ¶¨¼Û=¶¨¼Û*0.8 Where ÊéÃû like ¡®¼ÆËã»ú%¡¯ 12£®SELECT * FROM ѧÉú
WHERE ÄêÁä BETWEEN 19 AND 21 13£®SELECT * FROM ѧÉú
WHERE ѧºÅ IN(SELECT ѧºÅ FROM Ñ¡Ð޳ɼ¨) 14£®SELECT * FROM ѧÉú
WHEREѧºÅ NOT IN(SELECT ѧºÅ FROM Ñ¡Ð޳ɼ¨) 15£®SELECT ѧºÅ,AVG(³É¼¨) AS ƽ¾ù³É¼¨ FROM Ñ¡Ð޳ɼ¨ GROUP BY ѧºÅ HAVING COUNT(*)>=2 16£®SELECT s.ѧºÅ,ÐÕÃû,¿Î³ÌÃû³Æ,³É¼¨
FROM ѧÉú s join Ñ¡Ð޳ɼ¨ sc on s.ѧºÅ=sc.ѧºÅ Join ¿Î³Ì c on sc.¿Î³ÌºÅ=c.¿Î³ÌºÅ
WHERE ÐÕÃû LIKE ¡®Àî%¡¯
Îå¡¢¼ò´ðÌâ
1£®¹ØϵµÄÍêÕûÐÔ·ÖΪ£ºÊµÌåÍêÕûÐÔ¡¢ÓòÍêÕûÐԺͲÎÕÕÍêÕûÐÔ¡£ 2£®ÊµÌåÍêÕûÐÔÒªÇó±íÖв»ÄÜ´æÔÚÍêÈ«ÏàͬµÄ¼Ç¼¡£ ͨ¹ýÖ÷¼ü¿ÉÒÔ±£Ö¤ÊµÌåÍêÕûÐÔ¡£
3£®Ö÷¼üÔ¼ÊøºÍΩһֵԼÊø¶¼²»ÄÜÖظ´£¬Á½ÕßµÄÇø±ðÊÇ£ºÖ÷¼ü²»ÄÜÈ¡¿ÕÖµ£¬Î©Ò»ÖµÔ¼Êø¿ÉÒÔÈ¡Ò»¸ö¿ÕÖµ¡£
4£®É¾³ý¼Ç¼ʹÓÃdeleteÃüÁî,ֻɾ³ý¼Ç¼£¬²»É¾³ý±í½á¹¹¡£¶øɾ³ý±íʹÓÃdrop tableÃüÁ½«¼Ç¼ºÍ±í½á¹¹¾ùɾ³ý¡£
5£®ÊÓͼÊÇÒ»ÖÖÐé±í£¬ÊǾ¹ýÔ¤±àÒëµÄselect Óï¾ä£¬¾ÍÏñÒ»¸öÊý¾ÝɸѡÆ÷£¬Ñ¡È¡Óû§ÐèÒªµÄÐкÍÁС£ÊÓͼÓë»ù±¾±íµÄÇø±ðÊÇÊÓͼ²¢²»Õæ
Õý´æ·ÅÊý¾Ý¡£
6£®Ë÷ÒýµÄÖ÷Òª×÷ÓÃÊÇÌá¸ß²éѯЧÂÊ¡£Ë÷Òý·ÖΪ¾Û¼¯Ë÷Òý¡¢·Ç¾Û¼¯Ë÷Òý¡¢Î©Ò»Ë÷Òý¡£
7£®Êý¾Ý¿â±¸·ÝµÄ×÷Ó㺵±Êý¾Ý¿âÊܵ½Ëð»µÊ±ÓÃÓÚ»Ö¸´¡£±¸·ÝµÄ·ÖÀࣺ ? ÍêÈ«±¸·Ý ? ²îÒ챸·Ý ? ÊÂÎñÈÕÖ¾±¸·Ý ? ÎļþºÍÎļþÖ÷±¸·Ý
8£®ÔÚSQL ServerÖеÄÁ½ÖÖÉí·ÝÑé֤ģʽ£º ? WindowsÑé֤ģʽ ? »ìºÏÑé֤ģʽ