4

enter image description here When i build the following schema:

 CREATE TABLE CUSTOMER(
  CUSTOMER_ID INT NOT NULL,
  PRIMARY KEY(CUSTOMER_ID)
);

INSERT INTO CUSTOMER(CUSTOMER_ID) VALUES(1);

and run the following query:

SELECT CUSTOMER_ID FROM CUSTOMER;

I get no output. Can somebody please explain to me what is wrong?

Jacob
  • 14,463
  • 65
  • 207
  • 320
Skywarp
  • 989
  • 3
  • 15
  • 32
  • Did you build your schema on the left? – Tim Biegeleisen Nov 07 '16 at 16:36
  • sqlfiddle appears to be dead. You can build schema but any query appears to time out. Tried SQL 2014 and MySQL. – Paul Abbott Nov 07 '16 at 16:38
  • Yes schema is built on the left. Query runs on the right. Output should be on the bottom. I'm supposed to use this site for a school project. – Skywarp Nov 07 '16 at 16:48
  • According to this I should get output where highlighted: https://webapps.stackexchange.com/questions/34124/where-can-i-see-the-result-of-an-sqlfiddle-query – Skywarp Nov 07 '16 at 16:49
  • And no, this code has nothing to do with project, so not marked as homework. I'm just trying to get the tool to actually work before i start =/ – Skywarp Nov 07 '16 at 16:57

2 Answers2

4

For future readers.

You build the SCHEMA (DDL) in the left pane.

And you do the INSERT and or SELECT (and/or other work) in the ~right pane.

Aka, my "newbie" mistake was putting all my code in the left pane, including any insert/select statements. D'oh!

Aka, (to the original question), you need to move this statement:

INSERT INTO CUSTOMER(CUSTOMER_ID) VALUES(1);

to the top of your right pane.

See:

http://sqlfiddle.com/#!18/5bc0f/2

granadaCoder
  • 26,328
  • 10
  • 113
  • 146
1

it works just fine. see here sometimes sql fiddle stops functioning or shows loading error due to server load; perhaps that's why.

  • That was basically it. It worked just fine for me during the evening. I finished that project a while ago. – Skywarp Dec 06 '16 at 01:27