数据库和数据库表操作
作者:刘佳乐
- 2020.6.18
一、基本语法
1).创建数据库
CREATE DATABASE [IF NOT EXISTS] 数据库名;
2).删除数据库
DORP DATABASE [IF EXISTS] 数据库名;
3).查看数据库
SHOW DATABASES;
4).使用数据库
USE 数据库名;
二、Oracle上使用数据库
登录的适合使用数据库
1 mysql -uroot -D 数据库名 -p
2 enter password:ok
1.创建数据库
mysql> create database if not exists ljldata;
Query OK, 1 row affected (0.00 sec)
2.查询数据库
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| ljldata |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.01 sec)
3.删除数据库
mysql> drop database if exists ljldata;
Query OK, 0 rows affected (0.00 sec)
4.查询数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
5.使用数据库(也就是数据的切换)
mysql> use test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
3.结构化语言分类
4.创建数据库表语法
5.数据库列类型
1.数值类型
2.字符串类型