RELATIONAL DATABASES
Short Answer Questions / Conceptual Questions
Q1. What is the difference between degree and cardinality of a table? What is
the degree and cardinality of the following table?
Eno Name Salary
101 John Fedrick 45000
103 Raya Mazumdar 50600
Ans . Degree The number of attributes or columns in a table is called the degree of the table.
The degree of the given table is 3.
Cardinality The number of rows or records in a table is called the cardinality of the table.
The cardinality of the given table is 2.
Q2. Mention at least three limitations of DBMS.
Ans. Some limitations of DBMS are given below
( i ) High Cost DBMS requires various software , hardware and highly intelligent people for
operating and maintaining the database system . It increases its cost
( ii ) Database Failure If database is corrupted due to power failure or any other reason , our
valuable data may be lost or whole system stops .
( iii ) Data Quality With increased number of users accessing data directly . There are
enormous opportunities for users to damage data. So, it is not easy to provide a strategy to
support multiple users to update data simultaneously.
Q3. Explain the role of database management system in maintaining huge
volumes of data of different domains. Explain your views using an example.
Ans. A database management system is a specialised software that helps maintain large
volumes of data pertaining to a red life system. Examples of such systems include business
houses, transport systems, libraries, schools etc.
It not only stores bulk data in structured way but also helps to add, modify, search, update and
delete data from such databases. Examples of DBMS software’s are MySQL, Microsoft SQL
Server, Oracle etc.
Application program accesses the data stored in the database by sending request to the DBMS.
For example, MySQL, INGRES, MS - ACCESS etc. The purpose of a Database Management
System is to bridge the gap between information and data. The data stored in memory or on
disk must be converted to usable information.
Q4. A table "Sports" exists with 3 columns and 5 rows. What is its degree and
cardinality? 2 rows are added to the table and 1 column deleted. What t be the
degree and cardinality now?
Ans. The term degree refers to the total number of columns in table. The term cardinality
refers to the total number of rows in a table.
initially , Sports table has 3 columns and 5 rows , so Degree : 3 Cardinality : 5 After
operations , 2 rows are added to the table and 1 column deleted .Now, degree : 2 cardinality: 7
Q5. Differentiate the terms primary key and candidate key.
Ans. Differences between primary key and candidate key are
Primary key Candidate key
A primary key is a single field is a table that A candidate key is a set of columns who are
is used to identify he records uniquely. eligible for unique identification of records.
Only one filed among the candidate key is A table can have multiple candidate keys.
selected as primary key.
Primary key of a table is used in linking the Candidate keys do not have such role.
data of the table to another table.
Q6. What do you understand by the term database?
Ans. A database is a huge collection of data accumulating in a particular system. It comprises
of historical data, operation and transactional data. The database grows everyday with the
transactions dealing with it. A database has the following properties
( i ) It is a collection of data elements representing real - work information .
( ii ) It is logical , coherent and internally consistent .
Q7. What is a DBMS? Expand and explain in short.
Ans. A Database Management System is a software system that enables users to define, create
and maintain the database and provides controlled access to this database. The primary goal of
a DBMS is to provide a way to store and retrieve database information that is both convenient
and efficient. Data in a database can be added, deleted, changed, sorted or searched, all using a
DBMS.
Q8. What is a table? Also, write the other name of table.
Ans . Table is also called a relation, it is a diagrammatically a matrix of rows and columns that
store the data of a particular system. A table is just like a sheet in Excel, that stores data in
some columns and rows. The data is arranged under some fields, where each field stores
similar kind of data.
Q9. What do you mean by fields of a table? Give examples.
Ans . A field of a table is simply a vertical column of the table. A field is also called an
attribute. It stores similar kind of data. e.g. Name , Class , Marks etc. can be fields of student
table , Empld , Empname , Dept can be fields of Employee table . Each field derives its values
from a pool of data which is called as the domain. All the values in a single field will be of
same data type.
Q10. What are records? Also, write the other name of record.
Ans. A record is a horizontal row of a table storing complete data of one entity. It is also
called a tuple. e.g.
2 Mr. Das Sales 4 5000
The above record of Mr. Das carries all the information about him. Similarly other records of
the table carry data about other employees. All the records together make up the data of the
table.
Q11. What do you understand by the term degree of a table? Can it change?
Ans. The term degree refers to the total number of column x in a table. Yes the degree
changes with addition or deletion of columns. eg . If a table "Product" stores the data in
columns " PNo. PName Qty Price ", there are 4 columns, hence the degree will be L
Q12. What do you understand by the term cardinality of a table? How can it be
modified?
Ans . The total number of rows of a table is called the cardinality. It gets modified by the
addition or deletion of rows. If rows are added to the table the cardinality increases. If rows
are deleted the cardinality decreases.
Q13. What is a primary key? How many primary keys can be there in a table?
Ans . It is a combination of one or more fields in a table that can g the uniquely identify a
record. There can be only one p key in a table. It plays an important role in identifyin records,
because it is the primary key who carries unique values. The criteria for a field to become
primary key is It must be carrying unique and NOT NULL values.
Q14. What is candidate key?
Ans . All the field combinations that can serve as primary key for unique identification of
records in a table are called candidate keys. For example. If a student table carries " RollNo ,
Name , Class , AadharNo . , AdmissionNo columns , then columns Roll No. Aadhar No. and
Admission No can become the candidate keys since all carry unique values.
Q15. Can we have multiple candidate keys in a table? Give example.
Ans. Yes, we can have multiple candidate primary keys. eg . In an Employee table, ENo and
Aadhar No both can serve as primary key, hence both are candidate keys. Only primary key in
a table will be a single field, candidate keys can be multiple.
Q16. Which fields are regarded as alternate keys?
Ans . All the candidate key fields that are not primary key are alternate keys. eg . if table
Employee carries column " ENG EName , PFNo , Voterld " , then " ENo " is set as primary
key and the other candidate keys " PFNo " and " Voterld " will be the alternate keys .
Q17. Why foreign keys are allowed to have NULL values?
Ans. A foreign key is a field that links two tables. A table may have links to multiple tables
Each link is supported by a value that is common in the two tables. If there is a missing
foreign key value for a record, it means the link is missing and no matching values are present.
This is perfectly a valid situation, not an error.
Q18. How many foreign keys can be there in a table?
Ans. A table can have multiple foreign keys depending on the number of tables to which the
mother table has links. Multiple tables can be linked by the foreign key which will be common
in all of them. It is by the foreign key that the corresponding values will be obtained from the
tables.
E-R Diagram
E-R (Entity-Relationship) Diagram is used to represents the relationship between
entities in a table. ER diagrams represent the logical structure of databases. ER Diagram
represents relationship between two database tables.
E-R diagram means Entity Relationship diagram. Entity is an object of system, generally we
refer entity as database table, and the e-r diagram represents the relationship between each
table of database. E-R diagram represent entity with attributes, attributes is a property of
entity. If we assume entity is a database table then all the columns of table are treating as
attributes.
Entity: Entities are represented by rectangle. All table of database are treating as entity.
Attributes: Attributes are the properties of entities. Attributes are represented by means of
ellipses. Every ellipse represents one attribute and is directly connected to its entity
(rectangle). Attributes are represented by ellipses. Attributes are properties of entities.
If the attributes are composite, they are further divided in a tree like structure. Every node is
then connected to its attribute. That is, composite attributes are represented by ellipses that are
connected with an ellipse
Multivalued attributes are depicted by double ellipse.
Derived attributes are depicted by dashed ellipse.
Relationship
Relationships are represented by diamond-shaped box. Name of the relationship is written
inside the diamond-box. All the entities (rectangles) participating in a relationship, are
connected to it by a line.
A relationship where two entities are participating is called a binary relationship.
Cardinality is the number of instance of an entity from a relation that can be associated with
the relation.
One-to-one −When only one instance of an entity is associated with the relationship, it is marked as
'1:1'.
One-to-many − When more than one instance of an entity is associated with a relationship, it is
marked as '1:N'.
Many-to-one − When more than one instance of entity is associated with the relationship, it is
marked as 'N:1'.
Many-to-many − The following image reflects that more than one instance of an entity on the left
and more than one instance of an entity on the right can be associated with the relationship. It
depicts many-to-many relationship.