数据库作业
在linux系统下的MySQL
创建数据库
使用数据库
查询当前默认的数据库以及使用的编码方式校验规则
查询创建数据的语句
删除数据库
创建数据表
定义多个字段,用上所有数据类型
mysql> SHOW CREATE TABLE multi_tb;
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| multi_tb | CREATE TABLE `multi_tb` (`company_name` char(8) DEFAULT NULL COMMENT '公司名称',`introduce` varchar(100) DEFAULT NULL COMMENT '介绍',`content1` tinytext COMMENT '公司员工名',`content2` text COMMENT '内容1',`content3` mediumtext COMMENT '内容2',`content4` longtext COMMENT '内容3',`picture1` blob COMMENT '图片1',`picture2` mediumblob COMMENT '大图片',`picture3` longblob COMMENT '视频',`list` enum('X1','X2','X3') DEFAULT NULL COMMENT '选择列表',`list1` set('Y1','Y2','Y3','Y4') DEFAULT NULL COMMENT '公司的职业',`people1` tinyint DEFAULT NULL COMMENT '管理层人数',`area` smallint DEFAULT NULL COMMENT '公司面积',`gong_shu` mediumint DEFAULT NULL COMMENT '公司流动资金',`money` int DEFAULT NULL COMMENT '投资资金',`people2` bigint DEFAULT NULL COMMENT '公司员工编号',`wages` float(8,3) DEFAULT NULL COMMENT '平均工资',`wages_gong` double(10,2) DEFAULT NULL COMMENT '月营业额',`wages_nian` decimal(11,2) DEFAULT NULL COMMENT '年营业额',`date` date DEFAULT NULL COMMENT '日期',`datetime` datetime DEFAULT NULL COMMENT '日期加时间',`timestamp` timestamp NULL DEFAULT NULL COMMENT '时间戳',`time` time DEFAULT NULL COMMENT '时间',`year` year DEFAULT NULL COMMENT '年'
) ENGINE=InnoDB DEFAULT CHARSET=gbk |
+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)mysql>