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

MySQL schema命名规则

/*****************by
garcon1986************************************************************/
通用规则:

个数据库里的名字都尽量使用小写。这样能消除由于大小写(
case-sensitivity
)带来
的错误。
Mysql
默认区分大小写。
使
用下划线断开名字,名字中不能
使用空格。
名字中尽量不要
使
用数字。
名字中尽量不要
使用"
.",

样能避免在查询时出错

名字中不能使用保留字。

量使名字简单。
 
数据库名:

般情况下,使用项目名称作为数据库的名字。
数据库名字前加所有者的名字作为前缀。
 
表名:

以使用缩略词作为前缀
如:"
hr_”, "mkt_”,非别代表了human
resource, marketing部门。
不要使用通用的前缀
如:"
tbl_”,
"db_”,这样
没有实际意义,反而看起来更麻烦。
表名尽量简短,准确。

于表名的单复数,根据个人习惯决定,没有对错

 
列名:

键一般
是"
表名
_id”。

键的列名和另一个表的主键名一致

如:
create table manager
(manager_id int(11) primary key );
create table employee(
employee_id int(11) primary key,
manager_id int(11),
FOREIGN KEY (manager_id) REFERENCES
manager(manager_id) ON DELETE CASCADE)

名以
3
个字母的表格缩写为前缀

期列以"
date_”
为前缀
Boolean

型列以"
is_”
为前缀
引用:
MySQL database identifiers that can
be named include databases, tables, and columns. The MySQL documentation
contains extensive information about naming conventions. Here are some
of the naming conventions that you must use:
·        
All identifier names must be from 1 to 64
characters long, except for aliases, which can be 255 characters long.
·        
Database names must be unique. For each user
within a database, names of database objects must be unique across all
users (for example, if a database contains a department table created by
user A, no other user can create a department t


相关文档:

mysql 用同一表中的另一行记录的字段赋值

CREATE TABLE `user` (
  `db_id` varchar(255) NOT NULL,
  `name` varchar(45) default NULL,
  `age` int(10) unsigned NOT NULL,
  `address` varchar(45) default NULL,
  PRIMARY KEY  (`db_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
// 设置name='888'的age等于name='111' ......

MySql中的模糊查询

在MySql中的模糊查询和在MSSQL中的差不多,本记录主要是说在JDBC中使用PreparedStatement来构造一个模糊查询的语句。
模糊查询SQL语句:SELECT * from tableA WHERE colA LIKE '%要匹配的内容%'
构造PreparedStatement:
String sql = "SELECT * from tableA WHERE colA LIKE [-这里填什么呢?-]";
PreparedS ......

Linux安装apache、php和mysql方法

apache的源码安装 
将压缩包解压之后进入相应的目录
./configure \   #--------------------预编译命令
"--prefix=/usr/local/apache" \  #--------------------安装路径为“/usr/local/apache”
"--with-included-apr" \
"--enable-so" \ #--------------------开启相应的扩展模块 ......

IIS+PHP+MYSQL配置功略

PHP的执行效率是有目共睹的,这也是我喜欢它的原因之一,和它称为绝妙搭档的Mysql以及Apache想融合,不能不惊叹其效率了。PHP更新也很快,这里列举了目前最新版本PHP4.3.2RC4(几乎没有BUG了,估计写完这篇不久后正式版就出了),和最新版本的Mysql4.0.13的安装过程。   
  PHP的安装文件可以直接到 &nb ......

MySQL decimal 类型

      一般赋予浮点列的值被四舍五入到这个列所指定的十进制数。如果在一个FLOAT(8, 1)的列中存储1. 2 3 4 5 6,则结果为1. 2。如果将相同的值存入FLOAT(8, 4) 的列中,则结果为1. 2 3 4 6。这表示应该定义具有足够位数的浮点列以便得到尽可能精确的值。如果想精确到千分之一,那就不要定义使该类 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号