CREATE DATABASE mydb1 CHARSET=UTF8;USE mydb1;CREATE TABLE user age int id int password char20 nickname char20;SHOW TABLES;DESC user;
The given commands create a database called "mydb1" with a character set of UTF8, then switch to use that database. It creates a table named "user" with columns for age (integer), id (integer), password (character with a length of 20), and nickname (character with a length of 20).
The "SHOW TABLES" command displays a list of tables in the current database, and the "DESC user" command provides the structure of the "user" table.
原文地址: https://www.cveoy.top/t/topic/hVzy 著作权归作者所有。请勿转载和采集!