Community Manager at Infosec!
Who we are | What we do
Anyone know SQL
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'));
'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
-
JDMurray Admin Posts: 13,090 AdminThe 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?
-
diablo911 Member Posts: 36 ■■■□□□□□□□i figured it out, im good. Just when i thought computers couldnt get anymore boring, SQL Jesus Christ.
-
Infosec_Sam Admin Posts: 527 AdminWhat ended up being the issue? Was it the single quote thing that JDMurray mentioned?
-
diablo911 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.
-
AvgITGeek Member Posts: 342 ■■■■□□□□□□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_Sam Admin Posts: 527 AdminYeah, 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.
-
AvgITGeek Member Posts: 342 ■■■■□□□□□□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_Sam Admin Posts: 527 AdminClass 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."
-
AvgITGeek 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!
-
DatabaseHead Member Posts: 2,754 ■■■■■■■■■■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.