Learn SQL Manipulation – Manipulation – Introduction

Community%20FAQs%20on%20Codecademy%20SQL%20Exercises

This community-built FAQ covers the “Introduction” exercise in Codecademy’s lessons on SQL.

FAQs on the Codecademy SQL exercise Introduction

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about SQL in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!

Other FAQs

The following are links to additional questions that our community has asked about this exercise:

  • This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
  • Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
  • This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!

Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon (search) in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post (reply).

Learn SQL, Lesson 1, Manipulation Constraints, page 10/11

Still trying to fully understand the reasoning behind primary keys. Not sure if I got it 100%, but here goes.

In this instance, I create two tables
CREAT TABLE celebs
CREATE TABLE awards

They both have id rows

in the celebs table, id INTEGER
In the awards table, we have id INTEGER PRIMARY KEY

Is the purpose of this lesson simply to show that when we use PRIMARY KEY, we are establishing a unique identifier for all associated data in that row? So for example, in the celebs table we are using an integer ID, but in the awards table we are using a primary key. So maybe we want unique identifiers for awards but not general celeb information? So for celebs, 1-1,000 lets say, no big deal. But for awards, we want to ensure we use integers specific for each person. So if I pull up id 1 in awards, I can see all the awards this person may have, and no one else or their awards will be shown.

Does all that basically come off as the point to learn?
I saw another great example here - using invoice numbers instead of customer ID’s. As we want something to uniquely identify each customer based on the data we have. Using product_id or customer_id won’t help us hone in on what that specific customer purchased or used or etc.