Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql ³£ÓþÙÀý

drop table student;
create table student
(sno   int   not null unique,
 sname varchar(8) not null,
 ssex  char(2)    not null,
 sage int ,
 sdept varchar(20));
 
 select * from student;
 alter table student drop unique(sno);
 alter table student modify sno primary key;
 alter table student add constraints con_s check(ssex in('F', 'M'));
 
 insert into  student values ('0001', 'zhangwen', 'F', 24, 'math');
 insert into  student values ('0201', 'zhangzi', 'F', 24, 'jsj');
 insert into  student values ('0002', 'wangjing', 'M', 22, 'math');
 insert into  student values ('0301', 'lilu', 'M', 23, 'wuli');
 insert into  student values ('0003', 'wujun', 'M', 24, 'math');
 insert into  student values ('0202', 'wangli', 'F', 23, 'jsj');
 insert into  student values ('0203', 'jiangmin', 'M', 23, 'jsj');
 insert into  student values ('0302', 'lixiang', 'F', 23, 'wuli');
 insert into  student values ('0303', 'jinmin', 'F', 24, 'wuli');
 insert into  student values ('0304', 'jinmin', 'F', null, 'wuli');
 insert into  student values ('0204', 'jinmin', 'F', 22, '');
 delete from student where sno = '0204';
 update student set sname = 'luyong' where sno = '0304';
 insert into student values('0004','meinv','M',22,'math');
 insert into student values('0006','beauty','M',21,'math');
 ----------------------------------------------
 drop table course;
 create table course(cno int primary key,
                     cname varchar2(10) not null,
                     ccredite float(2));
        


Ïà¹ØÎĵµ£º

MysqlÖÐÎÄÂÒÂëÎÊÌâµÄС½á

¸ÅÊö£º
1.ÂÒÂëÎÊÌâ¹é¸ùµ½µ×ÊÇ×Ö·û¼¯µÄÎÊÌâ,ÄǾʹÓ×Ö·û¼¯ÉèÖ÷½Ã濼ÂÇ,²»ÍâºõÏÂÃæ¼¸·½Ã棺
  server(Mysql·þÎñÆ÷),client,database(Êý¾Ý¿â),connection(Á¬½Ó),result
  MySQLµÄ×Ö·û¼¯´¦ÀíÊÇÕâÑùµÄ£º
 £¨1£©·¢ËÍÇëÇó
      ¿Í»§¶Ë(character_set_client£©=¡·Êý¾ ......

MySQLÊý¾Ý¿âÎļþ½éÉÜ

±¾ÎÄÁ´½Óhttp://www.chysoft.net/files/article_234.htm ¸ü¶à×ÊѶÇë½øÈëwww.chysoft.net 
mysqlµÄÊý¾Ý´¢´æÄ¿Â¼ÔÚmysqlµÄÅäÖÃÎļþmy.iniÎļþÉèÖ㬸ñʽÈçÏ£º
# Uncomment the following rows if you move the MySQL distribution to another
# location
basedir = d:/cyoa/mysql_cy/
datadir = d:/cyoa/mysq ......

MySQLÊý¾Ý¿â±¸·ÝÓë»Ö¸´

·½·¨Ò»£º
1.µ¼³öÕû¸öÊý¾Ý¿â
ÃüÁîÐнøÈëµ½mysql°²×°Ä¿Â¼µÄbinĿ¼ÏÂ
¼ÙÉè×°ÔÚD:/mysql/bin
¼´£º¿ªÊ¼ ÔËÐÐ ÊäÈëcmd
d:
cd mysql/bin
È»ºóÖ´ÐÐÏÂÃæÓï¾ä
mysqldump -u Óû§Ãû -p Êý¾Ý¿âÃû > µ¼³öµÄÎļþÃû  
ʾÀý£ºmysqldump -u root -p sq_wcnc > d:\wcnc.sql
2.»Ö¸´Êý¾Ý¿â
   ³£ÓÃsource ÃüÁî ......

MySql²Ù×÷ÒªµãÕûÀí

TINYINT 1 ×Ö½Ú
SMALLINT 2 ¸ö×Ö½Ú
MEDIUMINT 3 ¸ö×Ö½Ú
INT 4 ¸ö×Ö½Ú
INTEGER 4 ¸ö×Ö½Ú
BIGINT 8 ¸ö×Ö½Ú
FLOAT(X) 4 Èç¹û X < = 24 »ò 8 Èç¹û 25 < = X < = 53
FLOAT 4 ¸ö×Ö½Ú
DOUBLE 8 ¸ö×Ö½Ú
DOUBLE PRECISION 8 ¸ö×Ö½Ú
REAL 8 ¸ö×Ö½Ú
DECIMAL(M,D) M×Ö½Ú(D+2 , Èç¹ûM < D)
NUMERIC(M,D) M×Ö½Ú(D ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ