What is an Entity in a Database?

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: NoSQL Databases: Design & Types

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:03 Entities
  • 1:00 Entity Attributes
  • 2:41 Entity or Attribute?
  • 4:39 Relationships
  • 5:33 Lesson Summary
Add to Add to Add to

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Login or Sign up

Timeline
Autoplay
Autoplay

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Martin Gibbs

Martin has 16 years experience in Human Resources Information Systems and has a PhD in Information Technology Management. He is an adjunct professor of computer science and computer programming.

This lesson describes the concept of an entity in a database. Entity attributes are also discussed along with the relationships between entities, including a simple example of an entity relationship diagram.

Entities

An entity is an object that exists. It doesn't have to do anything; it just has to exist. In database administration, an entity can be a single thing, person, place, or object. Data can be stored about such entities. A design tool that allows database administrators to view the relationships between several entities is called the entity relationship diagram (ERD).

In database administration, only those things about which data will be captured or stored is considered an entity. If you aren't going to capture data about something, there's no point in creating an entity in a database.

If you're creating a database of your employees, examples of entities you may have include employees and health plan enrollment.

Entity Attributes

An attribute defines the information about the entity that needs to be stored. If the entity is an employee, attributes could include name, employee ID, health plan enrollment, and work location. An entity will have zero or more attributes, and each of those attributes apply only to that entity. For example, the employee ID of 123456 belongs to that employee entity alone.

Attributes also have further refinements, such as domain and key. The domain of an entity describes the possible values of attributes. In the entity, each attribute will have only one value, which could be blank or it could be a number, text, a date, or a time. Here are examples of entity types and domains:

  • Name: Jane Doe
  • Employee ID: 123456
  • Health Plan Enrollment: Premium Plan
  • Work Location: RO, ME, Floor 2

Here's an example figure of an entity.

entity type

The key is the unique identifier that identifies the entity. A key is also a domain because it will have values. These values are unique to each record, and so it's a special type of domain. A key isn't always required, but it should be! In our example, a unique key value ensures that the Employee entity cannot have duplicate Social Security Numbers or Employee IDs.

Entity or Attribute?

The previous example of an employee leaves little doubt in the difference between an entity and an attribute. Jane is the entity and has an employee ID of 123456, which is the attribute. But what if we add in e-mail address? Is 'work location' an attribute of Jane, or is 'work location address' it's own entity? We could define an entity of 'work location' and add the attribute of 'name' to it. There really isn't a wrong answer, but it's something to consider when designing a database. Some rules of thumb to ponder when in doubt:

To unlock this lesson you must be a Study.com Member.
Create your account

Register for a free trial

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Free 5-day trial

Earning College Credit

Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it free for 5 days!
Create an account
Support