mysql 建库20181224

1. 建库

CREATE DATABASE ccut_soft DEFAULT CHARSET utf8;
SHOW DATABASES;
  1. 创建用户表
use ccut_soft;
CREATE TABLE   user_message(id INT  NOT NULL AUTO_INCREMENT PRIMARY KEY, 
   userNAME VARCHAR(50) NOT NULL,
   userpass VARCHAR(50) NOT NULL
     )ENGINE=INNODB DEFAULT CHARSET=utf8;   
######创建公司信息表
CREATE TABLE  company_message(id INT  NOT NULL AUTO_INCREMENT PRIMARY KEY, 
   NAME VARCHAR(50) NOT NULL,
   address VARCHAR(50) NOT NULL,
    email VARCHAR(50) NOT NULL,
   phone VARCHAR(20) NOT NULL
     )ENGINE=INNODB DEFAULT CHARSET=utf8;   
  
  1. 插入信息数据
USE ccut_soft;
INSERT INTO user_message(username,userpass) VALUES('长春工业大学','123')
INSERT INTO user_message(username,userpass) VALUES('ccut','ccut')

USE ccut_soft;
INSERT INTO company_message(NAME,address,email,phone)VALUES('中国移动','长春市宽城区北环城路','mobile@qq.com','10086');
INSERT INTO company_message(NAME,address,email,phone)VALUES('中国联通','长春市宽城区南环城路','union@qq.com','10010');
INSERT INTO company_message(NAME,address,email,phone)VALUES('中国电信','长春市宽城区南环城路','telecom@qq.com','10000');
INSERT INTO company_message(NAME,address,email,phone)VALUES('张三','长春市宽城区北环城路3000号','zhenqk@163.com','13544015827');
INSERT INTO company_message(NAME,address,email,phone)VALUES('李四','长春市宽城区北环城路3000号','zhenqk@qq.com','15818642542');
  1. 查看表结构
DESC company_message;
posted @ 2020-03-01 00:19  Tony小哥  阅读(162)  评论(0编辑  收藏  举报