Tables and
Relations in DBMS
Understanding the Formation and Properties
of Relations
tables/relations
in DBMS?
A table or relation is used to store
information about an entity.
entity is anything about which
information is stored in the
database.
An entity may have many
attributes with unique names.
Each attribute must have one and
only one value.
Forming
a
Relation
Relations store
information about
an entity.
Formed according
to the attributes of
the entity.
Example: Student
Information
System
Student
Information
System
Entities
Student
Teacher
Course List
Scholarship
Time Table
Course List
Scholarship
Student Entity Definition
STUDENT (RollNo, Name, DOB,
Address, Phone)
• The name STUDENT indicates
the name of entity.
• The fields in parentheses indicate
the attributes.
• Attributes are converted into
columns of the relation.
Properties of Relations
Characteristics
of relations:
No Duplicate Rows
Exist
The Order of Rows
is Insignificant
The Order of
Columns is
Insignificant
Columns/Attributes
are Atomic
A relation or table is the basis of a relational DBMS.
1. No Duplicate Rows Exist
• A table must not have
identical rows.
• Must have a column or set of
columns to uniquely identify
each row.
• Such column(s) is called
primary key.
2. The
Order of
Rows is
Insignificant
• The row's position is
insignificant.
• Rows can be retrieved in any
order.
3. The Order of Columns is
Insignificant
• The column's position is
insignificant.
• Columns are referenced by their
name.
• Columns can be retrieved in any
order.
4. Columns/Attributes are Atomic
• An entry at the intersection of each row and column
is atomic.
• An atomic value cannot be divided further.
• There can be only one value in each attribute.
What is
a View?
A virtual table that
displays data from
one or more tables.
Created using a
SQL query.
SQL stands for
Structured Query
Language.
Purpose of Using Views
Views keep data safe and secure.
User can specify records to be displayed.
Views display data according to user requirements.
Views provide flexibility and protect data from accidental
deletion or modification.
Creating Views
• A view can be created from one or more tables.
• The CREATE VIEW command of SQL is used.
It will create a view STUDENT-VIEW
CREATE VIEW STUDENT_VIEW AS
SELECT RollNo, Name
FROM STUDENT
WHERE Gender = 'M’;
This view will retrieve the records of only male students from
STUDENT relation

DBMS_ database managment system Tables_and_Relations.pptx

  • 1.
    Tables and Relations inDBMS Understanding the Formation and Properties of Relations
  • 2.
    tables/relations in DBMS? A tableor relation is used to store information about an entity. entity is anything about which information is stored in the database. An entity may have many attributes with unique names. Each attribute must have one and only one value.
  • 3.
    Forming a Relation Relations store information about anentity. Formed according to the attributes of the entity. Example: Student Information System
  • 4.
  • 5.
    Student Entity Definition STUDENT(RollNo, Name, DOB, Address, Phone) • The name STUDENT indicates the name of entity. • The fields in parentheses indicate the attributes. • Attributes are converted into columns of the relation.
  • 6.
    Properties of Relations Characteristics ofrelations: No Duplicate Rows Exist The Order of Rows is Insignificant The Order of Columns is Insignificant Columns/Attributes are Atomic A relation or table is the basis of a relational DBMS.
  • 7.
    1. No DuplicateRows Exist • A table must not have identical rows. • Must have a column or set of columns to uniquely identify each row. • Such column(s) is called primary key.
  • 8.
    2. The Order of Rowsis Insignificant • The row's position is insignificant. • Rows can be retrieved in any order.
  • 9.
    3. The Orderof Columns is Insignificant • The column's position is insignificant. • Columns are referenced by their name. • Columns can be retrieved in any order.
  • 10.
    4. Columns/Attributes areAtomic • An entry at the intersection of each row and column is atomic. • An atomic value cannot be divided further. • There can be only one value in each attribute.
  • 11.
    What is a View? Avirtual table that displays data from one or more tables. Created using a SQL query. SQL stands for Structured Query Language.
  • 12.
    Purpose of UsingViews Views keep data safe and secure. User can specify records to be displayed. Views display data according to user requirements. Views provide flexibility and protect data from accidental deletion or modification.
  • 13.
    Creating Views • Aview can be created from one or more tables. • The CREATE VIEW command of SQL is used. It will create a view STUDENT-VIEW CREATE VIEW STUDENT_VIEW AS SELECT RollNo, Name FROM STUDENT WHERE Gender = 'M’; This view will retrieve the records of only male students from STUDENT relation