mysql的创建数据库表及添加数据
C:\Users\ceshi>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.24 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database qa;
Query OK, 1 row affected (0.00 sec)
mysql> use qa;
Database changed
mysql> create table results(
-> id int not null auto_increment,
-> primary key(id));
Query OK, 0 rows affected (0.19 sec)
mysql> alter table results add column test_suit varchar(255);
Query OK, 0 rows affected (0.32 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table results add column test_name varchar(255) not null;
Query OK, 0 rows affected (0.28 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table results add column test_status varchar(10) not null;
Query OK, 0 rows affected (0.29 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> describe results;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| test_suit | varchar(255) | YES | | NULL | |
| test_name | varchar(255) | NO | | NULL | |
| test_status | varchar(10) | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
4 rows in set (0.02 sec)
mysql> insert into results(id,test_suit,test_name,test_status) values(2,"python web","article","200");
Query OK, 1 row affected (0.03 sec)
mysql的创建数据库表及添加数据的更多相关文章
- 数据库(一)--通过django创建数据库表并填充数据
django是不能创建数据库的,只能够创建数据库表,因此,我们在连接数据库的时候要先建立一个数据库. 在models.py中 from django.db import models class Pu ...
- MySQL 两个数据库表中合并数据
两个数据库表中合并数据 如果有 t1 和 t2 两个数据库表格,它们两个对应的字段是相同的.如何将 t2 的数据插入到t1中去呢? insert into t1 select * from t2 ...
- 【转】 iOS学习之sqlite的创建数据库,表,插入查看数据
原文: http://blog.csdn.net/totogo2010/article/details/7702207 iOS sqlite数据库操作.步骤是: 先加入sqlite开发库libsql ...
- iOS学习之sqlite的创建数据库,表,插入查看数据
目录(?)[-] 新建项目sqliteDemo添加使用sqlite的库libsqlite3dylib sqlite 的方法 获取沙盒目录并创建或打开数据库 创建数据表 插入数据 查询数据库并打印数据 ...
- ios sqlite的创建数据库,表,插入查看数据
iOS sqlite数据库操作.步骤是: 先加入sqlite开发库libsqlite3.dylib, 新建或打开数据库, 创建数据表, 插入数据, 查询数据并打印 1.新建项目sqliteDemo,添 ...
- POI框架实现创建Excel表、添加数据、读取数据
public class TestPOI2Excel {//创建2003版本Excel用此方法 @Test public void testWrite03Excel() throws Exceptio ...
- 使用MySQL Workbench建立数据库,建立新的表,向表中添加数据
使用MySQL Workbench建立数据库,建立新的表,向表中添加数据 初学数据库,记录一下所学的知识.我用的MySQL数据库,使用MySQL Workbench管理.下面简单介绍一下如何使用MyS ...
- C# 利用mysql.data 在mysql中创建数据库及数据表
C# 利用mysql.data 在mysql中创建数据库及数据表 using System; using System.Collections.Generic; using System.Linq; ...
- PowerDesigner创建表 拷贝创建表语句 SQLSERVER创建数据库 使用查询 创建表 并且添加数据
PowerDesigner创建表 : 1.双击打开PowerDesigner 2.双击打开Create model 3左键点击Model types,再点击Physical Data m ...
随机推荐
- css3/sass 样式记录
css3 width: calc(50% - 10px) sass 1.奇偶行 .classNameA { background:red; &:nth-child(even) { backgr ...
- win10 配置python3虚拟环境
1.安装virtualenv pip install virtaulenv 2.创建虚拟环境 env03 virtualenv env03 3.切换到进入虚拟换环境脚本目录(activate) cd ...
- [开源]OSharpNS 步步为营系列 - 1. 业务模块设计
什么是OSharp OSharpNS全称OSharp Framework with .NetStandard2.0,是一个基于.NetStandard2.0开发的一个.NetCore快速开发框架.这个 ...
- APP兼容性测试 (一) 机型选择概要
一.App兼容性问题有哪些 安装失败.启动失败.卸载失败,卸载不干净. 程序运行过程中闪退 部分控件显示不完整或者功能失效 屏幕显示异常 图片展示不全等 二.App兼容性测试的核心要点 测试软件是否能 ...
- 简明了解apply()和call()
apply()和call()都是ES6语法的,并且都是函数的方法. function foo() { alert(this.name) } var obj = { name: '小明' } foo() ...
- HDU 1723 Distribute Message DP
The contest’s message distribution is a big thing in prepare. Assuming N students stand in a row, fr ...
- 抓包工具 fidder4
抓包工具 fidder4 fidder4是一款基于windos灵活的抓包工具,可抓取pc端移动端的网络数据包. 安装 安装:fidder 4 下载:https://www.telerik.com/d ...
- F#周报2019年第23期
新闻 支持社区的WF与WCF开源项目 视频及幻灯片 F# MonoGame平台游戏系列:摄像头 Xamarin.Forms的F#与Fabulous ML.NET端到端之二:构建Web API 使用F# ...
- 如何down掉IB交换机口
服务器上找到需down的网络:ip a 通过ib命令iblinkinfo找到对应交换机以及在ib交换机上对应端口号 登录IB交换机,并通过命令:config进入配置模式 通过命令:port进入端口配置 ...
- python3之int类的常用方法练习
int类的常用方法练习 #coding:utf-8 #int类的常用方法 num1 = 18 num2 = -15 #查询创建num1所用的类 print(type(num1)) #num1占用的最小 ...