Get Adobe Flash player
Merry Christmas!

Beginning MySQL

Mysql数据库中常用字段类型:

整数型:TINYINT,SMALLINT,INT,BIGINT

小数型:FLOAT,DOUBLE,DECIMAL(M,D)

字符型:CHAR,VARCHAR

日期型:DATETIME ,DATE,TIMESTAMP

备注型:TINYTEXT ,TEXT ,LONGTEXT

创建一个简单的数据库:

创建一个数据库命令:CREATE TABLE
删除一个数据库命令:DROP TABLE
修改一个字段名称:RENAME TABLE `原字段` TO `新字段` ;
删除一个字段:ALTER TABLE `表` DROP `原字段`
插入一个字段:ALTER TABLE `表` ADD `新字段` … AFTER `原字段`

Example简单的实例:

CREATE TABLE `test` (
`id` int(10) NOT NULL auto_increment,
`username` varchar(25) NOT NULL,
`password` varchar(25) NOT NULL,
`registerdate` date NOT NULL,
PRIMARY KEY (`id`)
)

数据库中的常用SQL语句

1、SELECT 查询语句和条件语句

SELECT 查询字段 FROM 表名 WHERE 条件
查询字段:可以使用通配符* 、字段名、字段别名
表名: 数据库.表名 ,表名
常用条件: = 等于 、<>不等于、in 包含 、 not in 不包含、
like 匹配 BETWEEN 在范围 、 not BETWEEN 不在范围 <
、>
条件运算: and 、 or 、 ( )

2、排序,分组,指针查询,计算

分组语句:group by 字段 //语句最后 order之前
排序语句:order by 字段,字段 ASC / DESC //语句最后
limit之前
指针查询:limit 初始值,结束值 //语句最后
计算:
COUNT(*) 统计函数
MAX(*) 最大值函数
MIN (*) 最小值函数
AVG(*) 平均值函数
SUM(*) 累计值函数(∑)

3、Insert 插入语句

insert into 表名 (字段…,…) values(值…,…)
insert into 表名 values(值…,…)
//插入时须考虑清楚字段类型避免插入后出现缺值,乱码现象

4、Update 更新语句

UPDATE 表名 SET 字段 = 值 WHERE 条件 limit //limit可省略
常用条件: = 等于 、<>不等于、in 包含 、 not in 不包含、
like 匹配 BETWEEN 在范围 、 not BETWEEN 不在范围
条件预算: and 、 or 、 ( )

5、Delete 删除语句

DELETE FROM 表名 WHERE 条件 limit //limit可省略
常用条件: = 等于 、<>不等于、in 包含 、 not in 不包含、
like 匹配 BETWEEN 在范围 、 not BETWEEN 不在范围
条件预算: and 、 or 、 ( )

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

What can i design?

  • Logo Design and Brand Development: Whether you need to create a new brand or revitalize an existing one, I can help. I can design Logo Design, Identity Development, Brand Style Guides, Custom Illustration, Artwork Vectorization and much more!

  • Print Design, Business Collateral Production: I can design Business Systems, Photography, Production Work, business cards, letterhead, brochures, catalogs, mailers and much more!

  • Websites Design and Maintenance: I design killer websites for companies of almost every size and shape. I can design WebSite and WebSite Maintenance, E-Commerce, Content Managment and much more!

  • Creative Marketing and Logo Promotion: I can do Search Engines optimization, Email Marketing, Printed T-shirts, Logo Apparel, Promotion Gifts and much more!

I am a designer who is easygoing, useful, well-organized, independent, skillful, confidence, and calm under pressure.