When creating the SQL table, a 1064 error was encountered on line 6
P粉875565683
2023-08-26 08:59:47
<p><pre class="brush:php;toolbar:false;">CREATE TABLE Customer(
customer_id INT AUTO_INCREMENT PRIMARY KEY,
customer_name VARCHAR(50) NOT NULL,
customer_email VARCHAR(100) NULL,
street_address VARCHAR(50) NULL,
city VARCHAR(50) NULL,
province CHAR(2) NULL,
postal_code CHAR(6) NULL,
);</pre>
<p>As mentioned above, when trying to create a new table, I encountered error 1064 and am not sure why. The name "city" is not a reserved word, and as far as I know the definition is not outdated. </p>
<p><strong>#1064 - Your SQL syntax is incorrect; check the manual for your MySQL server version for the correct syntax to use near the ")" on line 6</strong>< /p>
can you try this
Remove the comma after postal_code