易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql到的几个问题

code1:建表
create talbe if not exsits disk.t_directories
(
id int(11) not null auto_increment,
user varchar(25) not null,
path varchar(255) not null,
parent_path varchar(255) not null,
dir varchar(20) not null,
create_time datetime not null,
primary key(id),
unique key user (user,path)
)engine=InnoDB default charset=utf8 collate=utf8_unicode_ci;
问题1:unique key user (user,path),这里应该是定义组合键(user,path)为unique,那这个user是什么意思,约束名吗?
问题2:有一个职工表,现在要使用一SQL语句,使得该职工表按男,女分组
  如果用select * from employees where gender='男';只能得到男职工表
  要得到一个按男,女分组的表,该SQL语句该如何写?

问题1:unique key user (user,path),这里应该是定义组合键(user,path)为unique,那这个user是什么意思,约束名吗?

create_definition:
  col_name column_definition
  | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...)
  [index_option] ...
  | {INDEX|KEY} [index_name] [index_type] (index_col_name,...)
  [index_option] ...
| [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY]
[index_name] [index_type] (index_col_name,...)
[index_option] ...
  | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...)
  [index_option] ...
  | [CONSTRAINT [symbol]] FOREIGN KEY
  [index_name


相关问答:

mysql的连接超时时间怎么设置 - VC/MFC / 数据库

我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("数据库连接失败") ......

eclipse与mySQL的问题 - Java / Eclipse

在安装Java编译器的Eclipse的时候,对环境变量进行了配置,在安装MySQl的时候也要对环境变量进行配置;那么后面的配置会影响前面的Eclipse的配置吗?
请大家多指教~!谢谢!
不会把,我这都装了的 我系统里 还装了 ......

Mysql 使用问题 - Java / Web 开发

我的Mysql 使用的时候 用dos建立的数据表 在dos中能显示出中文 
但是在 其他的可视页面 和网页中都显示乱码 如何解决?
在mysql控制台:show variables like 'char%';贴结果出来看看。

mysql命令行模式下: ......

vc++ 用mysql官方 connector 出错 - VC/MFC / 数据库

try
{
sql::Driver *driver;
sql::Connection *con;
//创建连接
driver = get_driver_instance();
con = driver->connect("tcp://192.168.18.52:3306", "root", "1234 ......

如何用MFC连接上MYSQL - VC/MFC / 数据库

如题。能不能给个例子,非常感谢

安装mysql时记得装 类库,里面有 mysql提供的函数借口,用它来连mysql很方便

好东西,共同学习


mysql++ 类,很方便很好用!

贴邮箱,发你

1.mysql api
2.myodbc
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号