mysql - SQL query doesn't work? -
i want create table in database , below query wrote; have idea why doesn't work?
1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'sname varchar(255), city varchar(255), avg int(20), clg# int(20) )' @ line 4`
create table stud ( s# int, sname varchar(255), city varchar(255), avg int(20), clg# int(20) );
the #
not valid character identifier. remove it:
create table stud ( s int, sname varchar(255), city varchar(255), avg int(20), clg int(20) );
you can review rules identifiers here. note put name in backticks:
`s#` int,
however, discourage using names need escaped.