给一个java创建mysql5.7表的一个语句例子
时间: 2023-06-05 20:07:28 浏览: 113
mysql57以上jdbc驱动jar
Sure, here is an example statement for creating a table in MySQL 5.7 using Java:
```java
String query = "CREATE TABLE users (" +
"id INT NOT NULL AUTO_INCREMENT," +
"username VARCHAR(50) NOT NULL UNIQUE," +
"password VARCHAR(50) NOT NULL," +
"email VARCHAR(100) NOT NULL UNIQUE," +
"PRIMARY KEY (id)" +
")";
```
This statement creates a table called `users` with four columns: `id` (an auto-incrementing integer and primary key), `username` (a non-null, unique string), `password` (a non-null string), and `email` (a non-null, unique string).
阅读全文