Members-only tutorial

Watch the video and get the practice sheet with membership.

See membership options

David Asks: About Primary Keys

About this Tutorial

Create relational databases with index/match. Discover the secret to efficient data management with primary keys! Learn how to sort, filter, and create tables based on unique identifiers in this expert video. Say goodbye to complicated spreadsheets and hello to easy data management.

Featured Formulas

Video Transcript

<div>&nbsp;Hello. In this video we're gonna answer a member's question. David. He asked about primary keys and what he's explaining is sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of, he has a database of clients or customers, and he has everything in one sheet. He could have, you know, up to like 40, 50 columns of data Understand how to manage and organize your data efficiently. Opens in new tab here. , it gets very difficult to manage multiple columns in the dozens, if not hundreds of columns of data Understand how to manage and organize your data efficiently. Opens in new tab .<br><br>When you really want to be able to say, take a column out, sort Learn how to sort your data effectively in spreadsheets. Opens in new tab it. And you can do this right with filter Discover how to use filters to streamline your data view. Opens in new tab , right? You can use the filter Discover how to use filters to streamline your data view. Opens in new tab , create a filter Step-by-step guide to creating filters in your sheets. Opens in new tab , you.&nbsp; have everything here.

But I personally have many problems with the filter Discover how to use filters to streamline your data view. Opens in new tab function Explore the various functions available in spreadsheets. Opens in new tab here. Sometimes you don't take everything, sometimes you only have like a filter Discover how to use filters to streamline your data view. Opens in new tab on some part of it, and then you try to edit it and it discombobulates and it makes things like you can sort Learn how to sort your data effectively in spreadsheets. Opens in new tab here, see, I've sorted that, but because I didn't select Learn about the SELECT clause in query functions. Opens in new tab this filter Discover how to use filters to streamline your data view. Opens in new tab , The G column, it didn't get sorted.<br><br>And so now this looks pretty bad. I know you see all the green around it, but this is not necessarily the best way to do things with this filter Discover how to use filters to streamline your data view. Opens in new tab function Explore the various functions available in spreadsheets. Opens in new tab .

So you might want to create another sheet and maybe their name you use as like the primary key. So there's a concept of primary key in something called a relational database where Understand how to use the WHERE clause in queries. Opens in new tab you have a unique Find out how to identify unique values in your data. Opens in new tab number Learn how to work with numbers in your spreadsheets. Opens in new tab or.<br><br> Sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of key code, like a unique Find out how to identify unique values in your data. Opens in new tab code that is always going to be this customer one. And now even if you change their name to Andrew, this unique Find out how to identify unique values in your data. Opens in new tab primary key is going to stay the same. Now, in most relational databases, this is actually an iterating key and it starts at one. And for every customer they will have a unique Find out how to identify unique values in your data. Opens in new tab number Learn how to work with numbers in your spreadsheets. Opens in new tab .<br><br>It, and it'll always be the next one up.

Now, this is great for databases because your primary key you can actually use your primary key to create other tables. And it's always going to be iterating. So even customer five here and even if I add a new customer, I'll always have a.&nbsp; number Learn how to work with numbers in your spreadsheets. Opens in new tab here. And even if I put in Andrew K, right?<br><br>This is different than this Andrew. And there might be, you know, other, other information here, right? And this is all unique Find out how to identify unique values in your data. Opens in new tab , even though the names might be the same, right? But your primary key is going to be unique Find out how to identify unique values in your data. Opens in new tab no matter. You cannot change it.

If you add a new customer, you add a new primary key, but iterating as well doesn't necessarily help.<br><br>It, it is good for like MySQL databases, so you can just always see how many customers have you always had, you have total. There are other unique Find out how to identify unique values in your data. Opens in new tab identifiers. One of them is U U I D. You can. , check that out in another video. UU ID is sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of this very long structured number Learn how to work with numbers in your spreadsheets. Opens in new tab . You can also create random characters.<br><br>You can base it off their name. There's some other options. But let's talk about sorting, filtering and creating tables based on primary keys.

No matter what your primary key is as long as it's unique Find out how to identify unique values in your data. Opens in new tab , you can do what I'm about to show you. So the main way that people use spreadsheets, right, is they create a main database and.<br><br>Then have a sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of a sorts you can create, you can sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of copy paste names, maybe that's all the names and you wanna do something with it. But after, let's say you don't want to be updating this, so you do something like array formula Discover the power of ARRAYFORMULA for dynamic calculations. Opens in new tab . .

I mean, this is pretty gnarly,&nbsp; way to do it, but what I'm about to show you later and, and how to solve some of these things is also a pretty crazy thing to do.<br><br>So stay tuned. So here's all of our data Understand how to manage and organize your data efficiently. Opens in new tab from our name column, and we want to say, assign a new thing to it. Say you want to put in a number Learn how to work with numbers in your spreadsheets. Opens in new tab .<br><br>And we have some that are different. Some, and how do we get it back to this, right? If we use this array formula Discover the power of ARRAYFORMULA for dynamic calculations. Opens in new tab and we sort Learn how to sort your data effectively in spreadsheets. Opens in new tab our one, let's sort Learn how to sort your data effectively in spreadsheets. Opens in new tab this A to Z Sort your data alphabetically from A to Z. Opens in new tab .<br><br>You see now we don't have everything, right? This name showed up, Andrew's out of order.

These customers are out of order. Or the, they're still in order, but this is all messed up, right? If we sort Learn how to sort your data effectively in spreadsheets. Opens in new tab this, let's say sort Learn how to sort your data effectively in spreadsheets. Opens in new tab this one and go back, see, our names are all out of order and these are not in the correct place.<br><br>So using this array formula Discover the power of ARRAYFORMULA for dynamic calculations. Opens in new tab is not a. Way to do this. So let's do it a different way. So what we can do is let's delete all of these, and instead of names, let's always grab the primary key, and that will be,<br><br>And the thing with primary key is we don't need this array formula Discover the power of ARRAYFORMULA for dynamic calculations. Opens in new tab , right?

If we have these numbers, we can just put in these numbers as we need to. So we don't need this array formula Discover the power of ARRAYFORMULA for dynamic calculations. Opens in new tab , meaning it'll always get resorted in everything. We don't need it. We just need to grab primary keys. And now we, how do we know who is who?<br><br>Well, we can do our new function Explore the various functions available in spreadsheets. Opens in new tab . So this is added. And what if we wanna actually know what, what is this information? We can do something called well, there's a few ways to this. We can do v lookup, but I always like doing index match Master the INDEX MATCH function for advanced lookups. Opens in new tab . And Index match Master the INDEX MATCH function for advanced lookups. Opens in new tab allows us to grab this data Understand how to manage and organize your data efficiently. Opens in new tab no matter where Understand how to use the WHERE clause in queries. Opens in new tab it is.

What do we want?<br><br>We want the name first. Let's actually get just a little bit of more information, like three columns. What we wanna do is we wanna match Learn how to use the MATCH function for finding positions. Opens in new tab .&nbsp; with the primary key. We always wanna do search type zero. Now we get column B through D for this primary key. Now this primary key, no matter what it is, let's say we add a new one, eight,<br><br>we can always add the primary keys. , we, we know what the primary keys are. Those never change. And our index match Master the INDEX MATCH function for advanced lookups. Opens in new tab can copy paste this all the way down. We can copy pastes all the way down.

We're gonna get some errors, but we're gonna get all of our information. So now we can add some more information here.<br><br>Added data Understand how to manage and organize your data efficiently. Opens in new tab . Okay, add 99 to here and now we can create a added data Understand how to manage and organize your data efficiently. Opens in new tab and do the exact same thing. Index Understand the INDEX function for retrieving data. Opens in new tab . We do index Understand the INDEX function for retrieving data. Opens in new tab , and in this case we want to do names and we know we will on the second column, so B through B, and we wanna match Learn how to use the MATCH function for finding positions. Opens in new tab our search. Key is going to be our primary key and our range Explore how to define and use ranges in your sheets. Opens in new tab is going to be names A through eight search type 0 0 0.<br><br>And now we get our inform. We can also auto fill Learn how to use autofill to save time in data entry. Opens in new tab here, and that's just index match Master the INDEX MATCH function for advanced lookups. Opens in new tab .

So index match Master the INDEX MATCH function for advanced lookups. Opens in new tab allows us to create these sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of secondary tables, add data Understand how to manage and organize your data efficiently. Opens in new tab based on the primary key, whatever that primary key is, and get it into a main table Discover how to create and manage tables in spreadsheets. Opens in new tab , right? This happens to allow us to reconsider how we do sheets and how we combine Find out how to merge cells for better data presentation. Opens in new tab sheets or create sheets.<br><br>We first, in fact, Have much less information originally than we needed, right? We don't need 40 columns of data Understand how to manage and organize your data efficiently. Opens in new tab because we can always combine Find out how to merge cells for better data presentation. Opens in new tab that stuff later.

What we can do is create a relational database based on this primary key, all over a many different sheets, and we can combine Find out how to merge cells for better data presentation. Opens in new tab those sheets into one main sheet if we do need all the information together in one place.<br><br>But this is what I like to do. I like to create sort Learn how to sort your data effectively in spreadsheets. Opens in new tab of a relational database, and I use index match Master the INDEX MATCH function for advanced lookups. Opens in new tab to.&nbsp; and I hope this video helped. There is also the possibility of using V lookup if you do, but always be weary. That V lookup always needs the unique Find out how to identify unique values in your data. Opens in new tab identifier to be in the far left column.

The first column index Understand the concept of column indexing in functions. Opens in new tab match Learn how to use the MATCH function for finding positions. Opens in new tab does not need that, so actually index match Master the INDEX MATCH function for advanced lookups. Opens in new tab allows a lot more flexibility in getting information and data Understand how to manage and organize your data efficiently. Opens in new tab based in o in other sheets.<br><br>All right. Hopefully this video was helpful to you.</div>