Question: I am trying to run this SQL code on MySQL Workbench and I keep getting errors and can not figure out why. CREATE DATABASE IF

I am trying to run this SQL code on MySQL Workbench and I keep getting errors and can not figure out why.

CREATE DATABASE IF NOT EXISTS fundraising;

USE fundraising;

DROP TABLE IF EXISTS Charities;

CREATE TABLE Charities (

Charity_id INT(11) PRIMARY KEY,

Charity_name VARCHAR(255),

City VARCHAR(255),

State CHAR(2)

);

INSERT INTO Charities VALUES (1, Readers for Seniors, Tampa, FL);

INSERT INTO Charities VALUES (2, Paws for Healing You, Orlando, FL);

INSERT INTO Charities VALUES (3, On Your Feet Rehab, Atlanta, GA);

INSERT INTO Charities VALUES (4, We Got You Covered Blankets, Augusta, GA);

INSERT INTO Charities VALUES (5, Mothers Against Cyberbullies, Raleigh, NC);

SELECT * FROM Charities;

The error Im getting

23:59:46 CREATE TABLE Charities ( Charity_id INT(11) PRIMARY KEY, Charity_name VARCHAR(255), City VARCHAR(255), State CHAR(2) ) Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Charity_name VARCHAR(255), City VARCHAR(255), State CHAR(2) )' at line 3 0.000 sec

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!