DB Concept
DB Concept
1. Table
A table is a collection of data represented in rows and columns. Each table has a
name in database. For example, the following table “STUDENT” stores the
information of students in database.
Table: STUDENT
2. Record or Tuple
Each row of a table is known as record. It is also known as tuple. For example,
the following row is a record that we have taken from the above table.
4. Domain
A domain is a set of permitted values for an attribute in table. For example, a
domain of month-of-year can accept January, February,…December as values, a
domain of dates can accept all possible valid dates etc. We specify domain of
attribute while creating a table.
An attribute cannot accept values that are outside of their domains. For example,
In the above table “STUDENT”, the Student_Id field has integer domain so that
field cannot accept values that are not integers for example, Student_Id cannot
has values like, “First”, 10.11 etc.
6. Keys
This is our next topic, I have covered the keys in detail in separate tutorials. You
keys in DBMS
Key plays an important role in relational database; it is used for identifying unique
rows from table. It also establishes relationship among tables.
Alternate Key – Out of all candidate keys, only one gets selected as primary key,
remaining keys are known as alternate or secondary keys.
Composite Key – A key that consists of more than one attribute to uniquely
identify rows (also known as records & tuples) in a table is called composite key.
Foreign Key – Foreign keys are the columns of a table that points to the primary
key of another table. They act as a cross-reference between tables.