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.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -