SQL - Day 2: Structured Query Language
SQL - Day 2: Structured Query Language
SQL - Day 2
Agenda
Entity
Different types of attributes.
Multi valued attributes.
Simple/ Atomic attributes.
Compound/Composite attributes.
Derived attributes.
Stored attributes
Complex attributes
Key attributes
Non-Key attributes
Required attributes
Optional / null value attributes.
Example 1:
Student
University
Database Professor Entities of University Database
Courses
Example 2:
Patients
Hospital
Doctors Entities of Hospital Database
Database
Tablets
Example 3:
Employees
Company
Department Entities of Company Database
Database
Clients
Customers
Bank
Account Sections Entities of Company Database
Database
Transaction Details
Types of Entities:
1. Tangible Entity
2. Intangible Entity
Tangible Entity:
Tangible Entities are those entities which exist in the real world physically.
Intangible Entity:
Intangible Entity: Intangible Entities are those entities which exist only logically
and have no physical existence.
Table
Rows
Columns
Cells
Table:
A table is a data structure that organizes information into rows and columns. It
can be used to both store and display data in a structured format.
For example, databases store data in tables so that information can be quickly
accessed.
Columns are mostly placed one after another in the continuous sequence. In a
table, columns are mostly separated from each other by lines, which help to
enhance readability and attractiveness.
For example: A person can have only one age, only one gender, and a manufactured
part can have only one serial number.
For example – A person can have more than one phone numbers or email ids so the
phone number or email id attributes are multivalued attribute.
Composite attribute
Composite attribute is an attribute where the values of that attribute can be
further subdivided into meaningful sub-parts."
‘Address’ is a composite attribute which can be divided into street number, city,
state, country etc.
For examples – Date of birth of a person cannot be further divided into sub parts.
For example:
Stored attribute.
Stored attributes are the attributes whose values cannot be derived using other
attributes.
Complex attribute.
Complex Attribute is a type of attribute in database. It is formed by nesting
composite attributes and multi-valued attributes in arbitrary way. We can say
this as the both are in the attribute.
For Example- Address attribute, address can be a combination of all the other
attributes like street Number, Locality Number, city, state, country.
Key attribute.
A key attribute is the unique characteristic of the entity.
Required Attribute.
A required attribute is an attribute that must have a value in it.
Thank You