11

Simple key in SQL

 2 years ago
source link: https://www.programmerinterview.com/database-sql/simple-key-in-sql/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Programmer and Software Interview Questions and Answers

What is a simple key in a dbms?

In a database table, a simple key is just a single attribute (which is just a column) that can uniquely identify a row. So, any single column in a table that can uniquely identify a row is a simple key. The reason it’s called a simple key is because of the fact that it is simple in the sense that it’s just composed of one column (as opposed to multiple columns) and that’s it.

Example of a simple key

Let’s go through an example of a simple key. Consider a table called Employees. If every employee has a unique ID and a column called EmployeeID, then the EmployeeID column would be considered a simple key because it’s a single column that can uniquely identify every row in the table (where each row is a separate employee). Simple isn’t it?

8 thoughts on “Simple key in SQL”


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK