Anyone know SQL

diablo911diablo911 Member Posts: 36 ■■■□□□□□□□
Im self learning this since its been 3 years at the junior college when i last took an SQL class, i forget everything and i have another sql class coming up this semester towards that dam 4 year degree, i have no idea why im getting this error, any ideas.

CREATE TABLE 'company'.'employee'(
'fname' VARCHAR(15) NOT NULL,
'mname' CHAR NULL,
'lname' VARCHAR(15) NOT NULL,
'ssn' CHAR(9) NOT NULL,
'Bdate' DATE,
'Address' VARCHAR(35) NOT NULL,
'Sex' CHAR NULL,
'Salary' DECIMAL(10,2) NULL,
'Super_ssn' CHAR(9) NULL,
PRIMARY KEY ('ssn'));

09:32:03    CREATE TABLE 'company'.'employee'( 'fname' VARCHAR(15) NOT NULL, 'mname' CHAR NULL, 'lname' VARCHAR(15) NOT NULL, 'ssn' CHAR(9) NOT NULL,  'Bdate' DATE, 'Address' VARCHAR(35) NOT NULL, 'Sex' CHAR NULL, 'Salary' DECIMAL(10,2) NULL, 'Super_ssn' CHAR(9) NULL,  PRIMARY KEY ('ssn'))    Error Code: 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 ''company'.'employee'( 'fname' VARCHAR(15) NOT NULL, 'mname' CHAR NULL, 'lname' V' at line 1    0.000 sec


Comments

  • JDMurrayJDMurray Admin Posts: 13,023 Admin
    The single quotes around the table name look odd to me. I would expect to only see quotes inside of parens. What SQL database are you using?
  • diablo911diablo911 Member Posts: 36 ■■■□□□□□□□
  • diablo911diablo911 Member Posts: 36 ■■■□□□□□□□
    i figured it out, im good. Just when i thought computers couldnt get anymore boring, SQL Jesus Christ.
  • Infosec_SamInfosec_Sam Admin Posts: 527 Admin
    edited August 2019
    What ended up being the issue? Was it the single quote thing that JDMurray mentioned?
    Community Manager at Infosec!
    Who we are | What we do
  • diablo911diablo911 Member Posts: 36 ■■■□□□□□□□
    @Infosec_Sam Ya single quotes, i just half to get through this semester and ill never half to touch it again as long as i breath.
  • AvgITGeekAvgITGeek Member Posts: 342 ■■■■□□□□□□
    edited August 2019
    SQL. You either love it or you hate it. Why do you think the SQL certification forum is dead?
    Never worked with MySQL. Only a little bit of Oracle and Progress but mostly MS SQLServer.
  • Infosec_SamInfosec_Sam Admin Posts: 527 Admin
    Yeah, I have a database class coming up this fall semester, so I'm really hoping to learn a bit more about SQL and database design. I had a similar class at the tech school a few years ago, but that was almost exclusively MS Access GUI work, which wasn't really doing it for me.
    Community Manager at Infosec!
    Who we are | What we do
  • AvgITGeekAvgITGeek Member Posts: 342 ■■■■□□□□□□
    edited August 2019
    So you are taking an admin class rather than a querying class? Administration is the easy part. Querying is a completely different animal. I learned the former and loved it and then learned the querying part and loved that as much or more than just admin.
  • Infosec_SamInfosec_Sam Admin Posts: 527 Admin
    Class Description: "Introduces the design and development of different types of electronic information systems, including database types, design issues, application development, and software selection and evaluation."
    Yeah, it looks like it's going to mostly high-level stuff. I'm right there with you though - I think it's super interesting, and I'd love to get down and dirty with SQL querying! 
    Community Manager at Infosec!
    Who we are | What we do
  • AvgITGeekAvgITGeek Member Posts: 342 ■■■■□□□□□□
    I'm interested to hear about the class @Infosec_Sam. Post back after it starts. This is my first gig where I'm 100% the SQL guy so I'm in it all day and still trying to learn what data is where and what does it mean. 4.5 months in and I still feel blind some days. lol!
  • DatabaseHeadDatabaseHead Member Posts: 2,753 ■■■■■■■■■■
    Make a living doing it.  Any questions hit me, I model data for a living for an EDW (and assist with building out transformations with Stored Procs).  Although I have to admit I am having a lot of fun with Python, soooooo much more intuitive than VBA.
Sign In or Register to comment.