7.2 Basic Database Terminologies
7.2 Basic Database Terminologies
Basic Database
Terminologies
SLO # 7.2.1
1
23-Sep-22
Database Terminologies
The terms field and attribute have similar Figure 1.1. A column (highlighted).
meanings.
Database Terminologies
Row (record, tuple)
2
23-Sep-22
Class Assignment
Q1- Differentiate between rows and columns?
(Any two)
Database Terminologies
Table (relation, file)
A table is a collection of rows. A table usually has a name, although some tables are
temporary and exist only to carry out a command. All the rows in a table have the
same shape (in other words, every row in a table contains the same set of columns). In
other database systems. The terms relation and file are all equivalent to a table.
View
A view is an alternative way to present a table (or tables). You might think of a view as a
"virtual" table. A view is (usually) defined in terms of one or more tables. When you create
a view, you are not storing more data, you are instead creating a different way of looking
at existing data. A view is a useful way to give a name to a complex query that you may
have to use repeatedly.
3
23-Sep-22
Class Assignment
Q2- Write two differences between table and views?
(Any two)
Database Terminologies
Data type
Data types define what type of data a column can contain.
Key
A DBMS key is an attribute or set of an attribute which helps you to identify a row(tuple)
in a relation(table). They allow you to find the relation between two tables. Keys help you
uniquely identify a row in a table by a combination of one or more columns in that table.
4
23-Sep-22
SLO # 7.2.2
Integer
Integer data types hold numbers that are whole, or without a decimal point.
Example
234 45678 1 67
5
23-Sep-22
Example
2.2 34.56 1.1
Boolean data
The Boolean data type is a data type that has one of two possible values (usually
denoted true and false).
6
23-Sep-22
Class Assignment
Q3- Identify the data type that can be used in the
following table.
SLO # 7.2.3
7
23-Sep-22
8
23-Sep-22
Class Assignment
Q4- Write any two purposes of using primary key.
Q5- Write two difference between primary key and
candidate key.
(Any two)
9
23-Sep-22
10
23-Sep-22
Summary of Keys
Key: Any column to identify record.
1- Primary key: Any unique value that cannot be modified. Each table can have
one.
2- Candidate key: contains unique value. Each table can have more than one.
3- Alternative key: Any key except primary. Each table can have more than one.
4- Secondary key: Any key that could be chosen as primary key.
5- Foreign key: Any primary key in other table. Can be repeated.
Class Assignment
Q6- While having the same data type, why foreign key
is different from primary key. Support your answer
with suitable statement
11
23-Sep-22
12