日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql报4934_mysql-Mariadb语法错误1064(42000)

發布時間:2023/12/4 数据库 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql报4934_mysql-Mariadb语法错误1064(42000) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

因此,當我嘗試在MariaDB中運行此腳本時收到以下錯誤:“ ERROR 1064(42000):您的SQL語法有錯誤;請查看與您的MariaDB服務器版本相對應的手冊以獲取正確的語法在附近使用

CREATE TABLE customers (

customer_id int NOT NULL,

customer_f

在第1行

奇怪的是,MariaDB似乎正在讀取命令的第一行,然后將下一行的一點讀為1行.整個腳本如下:如果有人可以幫助,我將不勝感激.

DROP TABLE customers;

DROP TABLE orders;

DROP TABLE products;

DROP TABLE orderitem;

?

CREATE TABLE customers (

customer_id INT NOT NULL AUTO_INCREMENT,

customer_firstname VARCHAR(20) NOT NULL,

customer_lastname VARCHAR(40) NOT NULL,

customer_phone CHAR(10) NOT NULL,

customer_email VARCHAR(60) NOT NULL,

customer_address VARCHAR(40) NOT NULL,

customer_city VARCHAR(40) NOT NULL,

customer_state CHAR(2) NOT NULL,

customer_zip VARCHAR(10) NOT NULL,

customer_aptnum VARCHAR(5) NOT NULL,

customer_pass CHAR(40) NOT NULL,

customer_type VARCHAR(10) NOT NULL,

PRIMARY KEY (customer_id),

INDEX customer_fullname (customer_firstname, customer_lastname),

UNIQUE (customer_email)

);

?

CREATE TABLE orders (

order_id INT NOT NULL AUTO_INCREMENT,

order_datetime DATETIME NOT NULL,

order_trackingnumber VARCHAR(20) NOT NULL,

order_shipdate DATETIME NOT NULL,

order_shipmethod VARCHAR(10) NOT NULL,

order_shipcarrier VARCHAR(10) NOT NULL,

order_totalprice DECIMAL,

customer_id INT NOT NULL,

PRIMARY KEY (order_id),

FOREIGN KEY (customer_id) REFERENCES customers(customer_id)

UNIQUE (order_trackingnumber)

);

?

?

CREATE TABLE products (

product_id VARCHAR(30) NOT NULL AUTO_INCREMENT,

product_beginningstockdate DATETIME NOT NULL,

product_endstockdate DATETIME,

product_category VARCHAR(15) NOT NULL,

product_name VARCHAR(60) NOT NULL,

product_availablequantity SMALLINT NOT NULL,

product_totalquantity SMALLINT NOT NULL,

product_price DECIMAL NOT NULL,

product_taxable DECIMAL NOT NULL,

product_itemstatus VARCHAR(15) NOT NULL,

product_discountpercent DECIMAL,

product_soldinstore char(3),

product_soldonwebsite char(3),

PRIMARY KEY (product_id),

UNIQUE (product_name)

);

?

/*INSERT INTO products (product_description, product_beginningstockdate, product_endstockdate, product_category, product_name, product_availablequantity, product_totalquantity, product_price, product_taxable, product_itemstatus, product_discountpercent, product_soldinstore, product_soldonwebsite)

VALUES

(...),

(...),

........ */

?

CREATE TABLE orderitem (

orderitem_id INT NOT NULL AUTO_INCREMENT,

order_id INT NOT NULL,

product_id VARCHAR(30) NOT NULL,

orderitem_priceperunit DECIMAL NOT NULL,

orderitem_quantityordered TINYINT NOT NULL,

PRIMARY KEY (orderitem_id),

FOREIGN KEY (order_id) REFERENCES orders(order_id),

FOREIGN KEY (product_id) REFERENCES orders(product_id)

);

總結

以上是生活随笔為你收集整理的mysql报4934_mysql-Mariadb语法错误1064(42000)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。