Laurent* Posted February 27, 2018 Share Posted February 27, 2018 Hey, I need to create a database and tables. I'm using phpmyadmin to do this. According to the professor's Power point slides the code below should create a table however it got me an error. I don't know how to think about this yet so go easy on me please. CREATE TABLE zodiacsigns (Sign VARIABLES(10), President VARIABLES(75)); Quote Error Static analysis: 2 errors were found during analysis. Unrecognized data type. (near "VARIABLES" at position 31) Unrecognized data type. (near "VARIABLES" at position 56) SQL query: CREATE TABLE zodiacsigns (Sign VARIABLES(10), President VARIABLES(75)) MySQL said: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARIABLES(10), President VARIABLES(75))' at line 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted February 27, 2018 Share Posted February 27, 2018 It tells you exactly what the problem is: Unrecognized data type. (near "VARIABLES" at position 31) You can find the list here: https://dev.mysql.com/doc/refman/5.7/en/data-types.html Link to comment Share on other sites More sharing options...
Laurent* Posted March 2, 2018 Author Share Posted March 2, 2018 I've looked through this and I still don't understand. I don't even what i'm creating honestly. I'm just trying to fix an error. Link to comment Share on other sites More sharing options...
Ingolme Posted March 2, 2018 Share Posted March 2, 2018 The code you presented is trying to create a table with two fields, each of type "VARIABLES," but "VARIABLES" is not a valid data type. My guess is that whoever wrote the query intended to write VARCHAR. 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2018 Share Posted March 2, 2018 I don't even what i'm creating honestly. I'm just trying to fix an error. How can you know if the error is fixed if you don't know what you're creating? 1 Link to comment Share on other sites More sharing options...
Laurent* Posted March 9, 2018 Author Share Posted March 9, 2018 (edited) I failed this assignment but I thrived in the next one which was worth more. Anyways the professors code examples aren't good and I decided to stop using the resources. This is why I struggled because I thought I needed to use his examples and I had a different SQL with different syntax. I was trying to create a data base named chinese_zodiac. This thread is done. Edited March 9, 2018 by Laurent* Link to comment Share on other sites More sharing options...
justsomeguy Posted March 9, 2018 Share Posted March 9, 2018 The error was because you were trying to tell it to use a data type that does not exist, so I linked you to the list of data types. Hopefully you know what general data type you were trying to store, if it was text or numbers or whatever, and could find an appropriate one in the list. If you don't know what kind of data you're trying to store, the first step is to figure that out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now