Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.

error in sql exercise Chapter IV - CREATE TABLE 'Employees';

+7 votes
I am at SQL Chapter IV - exercise 3 (Create table) and could not pass even the exercise is correct;

I tried again the same exercise and AGAIN it gave me: "Exercise Result:
 28% (4/14)Incorrect, check your code"

this how my prompt look in php:
========================
CREATE DATABASE 'mydatabase';
SHOW DATABASES;
CREATE TABLE 'Employees' (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
firstname TEXT,
lastname TEXT,
position TEXT,
age INTEGER
);
=======================
Result:
mydatabase.db
=======================

Can anybody tell me how to continue this exercise? It look like the given exercise and my input is identical. What's wrong? Can be placed below exercise a "SKIP" button,   "Sugested answers" or "Example" for learning purposes or such scenarios like above?
posted 5 years ago in SQL by SUNRISER (2,050 points)

1 Answer

–2 votes
Please get rid of the single quotes around the database name and the table name.

CREATE DATABASE 'mydatabase'; -> CREATE DATABASE mydatabase;

CREATE TABLE 'Employees' (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
firstname TEXT,
lastname TEXT,
position TEXT,
age INTEGER
);

to

CREATE TABLE Employees (
ID INTEGER PRIMARY KEY AUTOINCREMENT,
firstname TEXT,
lastname TEXT,
position TEXT,
age INTEGER
);
answered 5 years ago by codeadmin (113,880 points)

Related questions

–1 vote
1 answer
posted 5 years ago in SQL by SUNRISER (2,050 points)
+1 vote
1 answer
posted 5 years ago in SQL by yende (9,130 points)
+5 votes
1 answer
+4 votes
1 answer
posted 5 years ago in Python by Manuel Pacheco (1,280 points)