Q1:MYSQL数据库中怎么建立一个表呢?
进入mysql的命令窗口,敲命令:
create database 数据库名;
use 数据库名;
create table 表名(id int(4) not null primary key auot_increment; 字段名 数据类型;)
Q2:mysql数据库怎么创建数据表并添加数据
1、创建一个数据库test2
代码:mysql>createdatabasetest2;
截图:
2、创建一个mytable表
代码: mysql> create table mytable (name varchar(20), sex char(1),
-> birth date, birthaddr varchar(20));
截图:
3、显示表结构
代码:mysql> describe mytable;
截图:
4、向表中插入一条记录
代码:mysql>insertintomytable
->values(
->abc,f,1988-07-07,chian);
截图:
Q3:在dos命令下建立mysql数据库的表
这样就行了,
create table maxs(
friend_max int not null auto_increment,
diary_max int not null,
album_max int not null,
photo_max int not null,
comment_max int not null,
visit_max int not null,
user_max int not null,
head_max int not null,
p_comment_max int not null,
primary key(friend_max)
);
还有,别忘了选择数据库,就是在开头儿的地方加上 “use 数据库名”。
Q4:在MySQL中怎样创建一个数据库和数据表啊!!
在cmd命令提示符下输入
mysql -u root -p回车,然后输入密码回车
进入mysql命令行模式
create database databasename;//创建数据库
use databasename;//使用数据库
create table tablename(
id int not null primary key
);
这样就创建了一个只有id字段的tablename表