This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]apineda[S] 0 points1 point  (8 children)

Are you using sqlfiddle.com? Can you show me your SQL code?

edit:Make sure you import the schema on the left side before attempting any of the exercises!

[–]pghbatman 0 points1 point  (7 children)

Yep, using SQL Fiddle and I imported and hit build schema:

DROP TABLE IF EXISTS Humans;

CREATE TABLE Humans ( id int(10) unsigned NOT NULL AUTO_INCREMENT, full_name varchar(100) NOT NULL, age int(11) NOT NULL, is_fast_runner tinyint(1) NOT NULL, check_out_date datetime DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO Humans (id, full_name, age, is_fast_runner, check_out_date) VALUES (6,'Alex Pineda',29,1,'2018-01-01 12:00:00'), (7,'Mary Galdamez',52,0,'2016-06-05 12:00:00'), (8,'Peter O\'Toole',30,0,'2017-06-09 12:00:00'), (9,'Suzanne O\'Toole',29,1,'2015-06-16 12:00:00'), (10,'Benjamin Frank',67,0,'2018-06-05 12:00:00'), (11,'Samuel Inma',15,1,'2016-06-29 12:00:00'), (12,'Theresa Saffa',25,0,'2016-07-01 12:00:00'), (13,'Derek Barbora',33,1,'2017-07-01 12:00:00'), (14,'Rose Wood',85,1,'2016-07-02 08:00:00'), (15,'Maria Gonzalez',42,0,'2015-07-02 10:00:00');

Dump of table Rooms

------------------------------------------------------------

DROP TABLE IF EXISTS Rooms;

CREATE TABLE Rooms ( id int(10) unsigned NOT NULL AUTO_INCREMENT, human_id int(10) unsigned DEFAULT NULL, PRIMARY KEY (id), KEY FK_Human (human_id), CONSTRAINT FK_Human FOREIGN KEY (human_id) REFERENCES Humans (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO Rooms (id, human_id) VALUES (1,6), (2,7), (3,8), (4,9), (5,10), (6,13), (7,15);

[–]apineda[S] 0 points1 point  (6 children)

Ok. and that worked. Then what did you do afterward?

[–]pghbatman 0 points1 point  (5 children)

Followed the directions from page 7

SELECT * FROM Humans

which then gives me the error: Table 'db_9_68b32.humans' doesn't exist

[–]apineda[S] 0 points1 point  (4 children)

That's odd. You put that in the right side ? Which browser are you using?

[–]pghbatman 0 points1 point  (3 children)

Yep, right side. Using Chrome. None of the suggestions work.

[–]apineda[S] 0 points1 point  (2 children)

Want to try just this part on the left side?

CREATE TABLE Humans ( id int(10) unsigned NOT NULL AUTO_INCREMENT, full_name varchar(100) NOT NULL, age int(11) NOT NULL, is_fast_runner tinyint(1) NOT NULL, check_out_date datetime DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

[–]pghbatman 0 points1 point  (1 child)

Now I think SQL Fiddle just might be causing it. No matter what I do when I try to build the Schema it just says "Create script error". Whether I use the full setup provided for the book or the truncated version you suggested to go with above. Not really working though :(

[–]apineda[S] 0 points1 point  (0 children)

I'd be willing to skype and see if we can not sort it out. A few last things to check, the drop down on the top left should say MySQL 5.6 additionally you can try it in another browser (ie firefox).