Error in my SQL syntax on SQL Fiddle

I'm new to sql programming. For a computer science project I am trying to apply my knowledge of sql in some way. On SQL Fiddle, I am using the MySQL 5.6 database and I am having so much trouble building schema. This is what it keeps telling me:

"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 '[ Name varchar[15], Description varchar[50], Ranking int, ]' at line 2"

I need help either learning how to use SQL Fiddle or how to build my schema. Thanks and my code is below.

CREATE TABLE food ( Name varchar(15), Description varchar(50), Ranking int, ); insert into food values ('Watermelon', 'A yummy fruit', 9);

-------------Problems Reply------------

you have a comma after Ranking int.

Corrected Code:

CREATE TABLE food ( Name varchar(15), Description varchar(50), Ranking int );
INSERT INTO food values ('Watermelon', 'A yummy fruit', 9);

Category:mysql Views:10 Time:2018-10-31

Related post

  • Differences in SQL syntax between SQL Server 2005 and ADO.Net? 2011-01-04

    I was wondering if there was a compilation of any known differences in accepted SQL syntax structure between running a query directly in SQL Management Studio and creating a sql query as a string in a .net application and sending it through a SQLComm

  • Can I change my tables properties with SQL syntax in SQL server 2008? 2012-04-29

    I have a database on my student server, I need to go to my university if I want to access the database properties using the SQL server DBMS, it is a pain. I want to know if I can change the identity specification by using SQL on a specific table? I c

  • How do I validate SQL syntax in SQL Server 2008 R2? 2012-02-19

    Is there the option to check syntax after I have completed create a query? If so, where can I find it? What does it validate and what does it not validate? --------------Solutions------------- You can click the Parse query button in Management Studio

  • UPDATE query works fine when run from Access, but raises SQL syntax error from within C# app 2008-12-16

    I have a very simple Update statement that will update mail server settings and network credentials info... Query works fine when I run it in Access but C# keeps giving me the error stating that my SQL Syntax is wrong ... I have a dataaccess layer (d

  • SQL syntax error when creating a stored procedure in MYSQL 2009-03-12

    i have a hard time locating an error when trying to create a stored procedure in mysql. if i run every single line of the procedure independently, everything works just fine. CREATE PROCEDURE cms_proc_add_child (param_parent_id INT, param_name CHAR(2

  • SQL Syntax Error - PHP/MySQL 2009-11-07

    Can anyone tell me what's going on here. I'm not sure why this code is not working and throwing the following error: 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

  • PHP/MySQL - SQL syntax error? 2009-12-09

    Now when I submit the character ' I get the following error listed below other then that everything is okay when I submit words. I am using htmlentities() and I still get this error. How can I prevent this error from happening is there a way I can al

  • SQL syntax errors when using php echo $_SERVER['PHP_SELF']; 2009-12-30

    I'm trying to submit a page onto itself by using php echo $_SERVER['PHP_SELF']; but keep receiving the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use n

  • SQL Error: SQL Syntax Error 2010-01-04

    Error Message: SQL Error: 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 'AND domain = 'ard.qc' AND snapshot_id = 2010 AND locale = 'en_US'' at line 1 SQL Query: S

  • SQL: Syntax error with intersect? 2010-02-20

    This is my query: -- Sids of suppliers who supply a green part AND a red part (SELECT Suppliers.sid FROM Suppliers JOIN Catalog ON Catalog.sid = Suppliers.sid JOIN Parts ON Parts.pid = Catalog.pid WHERE Parts.color = "red") INTERSECT (SELECT Supplier

  • Simple query throwing an SQL syntax error 2010-02-22

    I've got a simple SQL query that keeps throwing an SQL syntax error. It looks like this: $sql = "SELECT COUNT(*) AS TOTAL FROM PRODUCT WHERE ID_PRODUCT = ".$id; $result = mysql_query($sql) or die(mysql_error()); Which throws : You have an error in yo

  • MySQL syntax:You have an error in your SQL syntax 2010-04-03

    I have written a very simple function: function editCategory() { $ID = urlencode($_GET['id']); $cname = mysql_fix_string($_POST['cname']); $kabst = mysql_fix_string($_POST['kabst']); $kselect = $_POST['kselect']; $subsl = $_POST['subsl']; $kradio = $

  • Why is is giving me an SQL syntax error? 2010-04-05

    Do you have any idea why i get this: 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 '``, `title` varchar(255) collate latin1_general_ci NOT NULL default ``,' at li

  • Error in SQL Syntax ERROR1064 2010-04-16

    Everytime I try to create the following table in MySQL command line: CREATE TABLE book( `book_id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `isbn` char(20), `title` char(20), `author_f_name` char(20), `author_l_name` char(20), `condition` ENUM("as new

  • Unable create a table - ERROR 1064 (42000): You have an error in your SQL syntax 2010-05-03

    I'm trying to execute this simple command: create table foo (clo int primary key unsigned auto_increment); But I get this error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

  • PHP | SQL syntax error when inserting array 2010-05-11

    I am having some trouble inserting an array into the sql database. my error is as follows: Unable to add : 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 '06:45:23

  • i got sql syntax error when i debug my application 2010-06-10

    I want to update my database using formatsqlparam, but when I debug it, it has an error saying: "Incorrect syntax near ','." This is my code: Dim sql2 As String = "update infoHotel set nameHotel = N" & FormatSqlParam(hotel) & _ ", knownAs1 =

  • SQL syntax error with Derby and Circumflex ORM 2010-06-24

    I'm trying to use Circumflex ORM (as suggested on StackOverflow - here, here and here) to connect to a local (embedded) Apache Derby database over JDBC from a Scala project (built with simple build tool). I've followed the instructions carefully, but

  • MySQL "an error in your SQL syntax" 2010-07-13

    I'm trying to change a database entry with PHP but is stuck with this error message: Error: 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 'Bjelkholm Lövgren AND a

  • Install script MySQL syntax error "You have an error in your SQL syntax; [-] " 2010-07-31

    I have an install script on my website, and when i run it, it gives me thsi error: 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 'CREATE TABLE active_guests ( ip

  • SQL Syntax error on one machine but not the other 2010-08-11

    I have a legacy web-site that I am maintaining (built mostly in classic ASP with vbscript). I am making some modifications to it, and got tired of waiting 5 minutes everytime I had to go through one of the pages that was loading 99000 records from th

  • JPQL MySQLSyntaxErrorException: You have an error in your SQL syntax 2010-09-05

    I have two entities User and Group: @Entity public class User implements Serializable { private static final long serialVersionUID = 1L; @Id private String username; private String password; private String email; @ManyToMany @JoinTable(name="user_gro

  • 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 ' 2010-10-07

    I am trying to insert html pages to MySQL with my Asp.NET project but i am getting error; 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 'de Osman patlaması', '',

  • PHP & MySQL - You have an error in your SQL syntax problem 2010-10-13

    I get this error below and was wondering what is it? And what can I do to fix it? 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 ') AND articles_comments.user_id I

  • MYSQL ERROR 1064 (42000) - error in SQL syntax 2010-10-18

    I'm importing some entries into a MYSQL table and it breaks on one of the INSERT statements with the following error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.105 (s). 11 q(s)