我正在使用 xampp。
创建数据库后
CREATE DATABASE University + use University
我通过键入创建表
CREATE TABLE Student
(
SNo INT NOT NULL,
SName VARCHAR(16) NOT NULL,
SAge INT NOT NULL,
SDepartment ENUM('CS', 'EE', 'Math', 'Physics') NOT NULL,
PRIMARY KEY (SNo)
);
但是会发出哔哔声,并且
ERROR 1064 (42000): You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near 'use University
CREATE TABLE Student
(
SNo INT NOT NULL,
Sname VARCHAR(16) NOT NULL,
SAg'
at line 2
显示在命令提示符中。但我不知道在这种情况下语法错误是什么。