Need help with Celestial Bodies tutorial (SQL)

So I started the tutorial on relational databases, did the bash part and the mario database which both were very nice, although I was familiar with the bash commands presented in the tutorial I liked the interactivity of ti and kept on with it until I finished it.

Now I started the Celestial Bodies one but I am confused…

It asks me to do a bunch of things at once but doesnt provide enough detail.

I mean it tells me to create 4 tables (galaxy, planet,star,moon) but then it also says “your database must have at least 5 tables)”

It tells me to create on each table a row named “_id” and make it a primary key and serial and create an other row named “name” but it also says “you must create at least 3 rows and the tables must have foreign keys to relate with each other”

Then it says that at least one row needs to be INT at least one row needs to be boolean (boolean? as in true or false? ) and in general data types that I cant put in the rows it tells me to make (name and _id ) so I guess I should figure out rows that are relevant and apply with such data types…

Like I am not an astronomer am I supposed to figure out the data I should put and how it relates with each table?

What would the 5th table be?

To word my self in a different way, am I missing something?

Or am I supposed to put random/googled data that would just serve as a placeholder in order to add the extra column and data types and use my imagination in general lol ?

Like in the latter case will I proceed normally ? to the next task? is there a next task or the entire tutorial is about this one task asking me to figure stuff out about what kind of data I should enter and how to use boolean with meaning given the context ?

That’s a project for certification. It doesn’t have multiple steps directing to the final goal, but rather contain set of requirements, that project (database) should fulfill.

Thanks for clarifying that detail (I mean I was aware that it is part of the certification but wasnt aware that its only “1 step” )

like its the 3rd “box” in this curriculum so I should ignore it for now and proceed with the one under it? " Learn Bash Scripting by Building Five Programs" ?

I know that there is no rule on which tutorials to take or at what order but what is the “expected” way by the freecodecamp authors? for me to leave that for now or to do it before I proceed with the other ones?

Concepts in the two first tutorials should be enough to complete that project. Doing further tutorials first might give you more confidence and get more familiar with things that repeats themselves.

Keep in mind however, projects are harder. You are not expected to be able to remember every syntax or command from previous tutorials, but at the same time, you might need to take a look again at them to see how something is done and use that as guide.

I’d try doing project in order, you can approach each requirement as a separate step and see how it will be going with solving them. Ultimately the order is up to you.

Well syntax wise its not a hard project what makes it hard for me is the lack of instructions regarding the actuall data

and the demands in general e.g ok lets make a 5th table, but it named to me only 4 tables (galaxy,star,planet,moon) so what should that 5th table be all about?

Or to add rows with INT and boolean…

Ok lets say I add a row with e.g “volume” e.g of a planet… but what would I do with boolean (also I wasnt tought how to make use of booleans in the context of a database )

Anyway I will leave it for now and do the other things first :stuck_out_tongue:

The lack of specific data to use is intentional @papajo. The purpose is to leave room for creativity, and to make it so every users project isn’t identical.

Still I would prefered to have some guidelines on what makes booleans useful in a database/how to handle them and proper syntax before having to do this I hope that the next lessons will mention booleans in the context of SQL otherwise I would have to google them

for the time being I am doing the HTML tutorial (I started it to do something while waiting for helpful feedback like yours in this topic :stuck_out_tongue: ) and probably will continue with the rest of the tutorial and catch up with celestial bodies later

I will advise you go over the previous tutorials on SQL and take some notes. These note will help you in this particular project. As for naming, it’s not important what you name the fifth table. The test is just to see five tables, period. I believe you can scale through this project by reviewing the past course(s) on SQL. That was what I did that enabled me to pass all tests… You can also try designing your tables on paper before implementing them.
Good luck!

1 Like

@oromesuo1 That’s partially the issue, the previous tutorials (basic bash commands and mario database) did not mention the syntax (or what is more important to me at this point) the usecase of booleans as a field for a row in a table.

I mean in coding and in general I know what a boolean is, for me it is particularly useful as a flag to keep a for/while loop going on or terminate it.

But in the context of a database I cant figure/imagine how it would be usefull (in comparison with just entering a text/varchar field instead labeled as “true” or “false” )

In terms of what the difference would be in a “read/retrieve data” query and in terms of general structure in general.

As for the names and data in general since it is for the certification I would like to make something a laittle more decent than just entering placeholder random text.

I figured some stuff I could use booleans for e.g for the table galaxy I could add a column spiral and rows true or false for that

But I still dont see how this would be different e.g by entering rows as text or varhchar and labeling them true or false for the column spiral.

I mean in both situations the read syntax would be the same e.g SELECT * FROM galaxy WHERE spiral=‘False’

This would work no matter if the column spiral would have been a type of boolean or text or varchar… :confused:

So it doesnt make sense to as to why use boolean in the first place… there must be a reason for its existence and I would like a tutorial in the curriculum that defines that usecase.

I hope such a mention exist in the following lessons but I will finish this one first :stuck_out_tongue: hopefully today :stuck_out_tongue:

What did take me so much time was not the sql syntax/coding that is trivial its the content that took time to me since I have a very superficial knowledge about astronomy which hindered me from creating tables that make sense and would have meaning relations which each other (still try to figure out what could a 2 PK 2collumn table would be so that it could “connect” nicely two other tables that dont share FK or PK with each other so that I could join them with a FULL join query :stuck_out_tongue: )

If I knew more about astronomy I could code this in a minute max lol since as I mentioned the code needed for this cert is trivial.