Create mySQL table - Closing bracket error

I am trying to create a new table based on the below code. This is currently an access table that is being converted for an online program.

CREATE TABLE Reactivation(
  BASEHHID CHAR(8) NOT NULL,
  SOURCECODE VARCHAR(50),
  INQDATE DATETIME NOT NULL,
  MAILFLAG TINYINT('0', '1') NOT NULL,
  EMAILADDRESS VARCHAR(255),
  EMAILPROMO VARCHAR('Y', 'N') NOT NULL,
  LASTTRIP VARCHAR('A', 'B', 'C', 'X') NOT NULL,
  NORTHAMERICA VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  CENTRALSOUTHAMERICA VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  EUROPE VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  ASIAFAREAST VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  AUSTRALIASOUTHPACIFIC VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  AFRICAMIDDLEEAST VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  SMALLSHIPCRUISING VARCHAR('Y', 'N') NOT NULL DEFAULT 'N',
  AGE TINYINT('1', '2', '3', '4', '5', '9') NOT NULL,
  BASEHHID2 CHAR(8) NOT NULL,
);

Error: a closing bracket was expected.

TINYINT('0', '1') is invalid syntax

VARCHAR('Y', 'N') is invalid syntax

all of the various forms of the above are invalid syntax

Thanks, Just learning.
Could you give me a example of how to create a field that would allow only those values?

you would use a CONSTRAINT, specifically a CHECK

did you say you use MS Access?

With the fields that are for the different regions, are most expected to be ā€˜Nā€™ for most records?

N would be the default, and more than 50% of the time correct, but needs to be able to be changed to Y.

This is a data entry project from MS Access database.

Yes MS Access Database is used now for this project and looking into creating the back-end on mySQL instead.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.