Screen Link:
https://app.dataquest.io/m/257/guided-project%3A-analyzing-cia-factbook-data-using-sql/3/overview-of-the-data
My Code:
SELECT *
FROM sqlite_master
WHERE
LIMIT 5;
Replace this line with your code
What I expected to happen:
id |
code |
name |
area |
area_land |
area_water |
population |
population_growth |
birth_rate |
death_rate |
migration_rate |
1 |
af |
Afghanistan |
652230 |
652230 |
0 |
32564342 |
2.32 |
38.57 |
13.89 |
1.51 |
2 |
al |
Albania |
28748 |
27398 |
1350 |
3029278 |
0.3 |
12.92 |
6.58 |
3.3 |
3 |
ag |
Algeria |
2381741 |
2381741 |
0 |
39542166 |
1.84 |
23.67 |
4.31 |
0.92 |
4 |
an |
Andorra |
468 |
468 |
0 |
85580 |
0.12 |
8.13 |
6.96 |
0.0 |
5 |
ao |
Angola |
1246700 |
1246700 |
0 |
19625353 |
2.78 |
38.78 |
11.49 |
0.46 |
What actually happened:
type |
name |
tbl_name |
rootpage |
sql |
table |
facts |
facts |
47 |
CREATE TABLE “facts” (“id” INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, “code” varchar(255) NOT NULL, “name” varchar(255) NOT NULL, “area” integer, “area_land” integer, “area_water” integer, “population” integer, “population_growth” float, “birth_rate” float, “death_rate” float, “migration_rate” float) |
Replace this line with the output/error
2 Likes
You are not currently following the instructions exactly -
In a different code cell, write and run another query that returns the first 5 rows of the facts
table in the database.
You need to return rows from the facts
table.
1 Like
SSharma
#3
Hi, Can anyone explain why do we have to run this query. I mean what does the output of this query is telling?
%%sql
SELECT ***
** FROM sqlite_master
** WHERE type=‘table’;**
1 Like
Please create a separate post for your question since it’s not related to the question in this current post.
1 Like
Can you give details to answer this question= I am not understanding it either.
1 Like
Can you describe what part is confusing you specifically?
1 Like
I do not know how to load facts db from the mentioned table.
I do not know how to open the table appearing in 1st point of step 4/8.
Ok, I just got it.
%%sql
SELECT *
FROM facts
LIMIT 5;
2 Likes
Hi, I just tried doing this
%%sql
SELECT *
FROM facts
but it returns an error for %%sql
Does anyone know what is the problem?
1 Like
Did you run
%%capture
%load_ext sql
%sql sqlite:///factbook.db
in the previous chunk?
2 Likes
Hi @midnight348 you can as well move to menu bar to restart and run the kernel, if that not working then confirm if you included the code below.
%%capture
%load_ext sql
%sql sqlite:///factbook.db
1 Like
Hello! I realized I did not. I have tried it now and it works! thanks 
2 Likes