Uploaded by raghavsaran02

g12 Important Questions Database Concepts

advertisement
Important Questions Database
Concepts
Question. What are all the domain names possible in
gender?
Answer. Male, Female and third gender
Question. What is primary key?
Answer. A primary key is a set of one or more attributes that can
uniquely identify the relation.
Question. What is database schema?
Answer. The design of the database is known as the
database schema.
Question. Explain the degree of table.
Answer. The degree of the table denotes the number of columns.
Question. Which type of relationship is supported by
network model?
Answer. Network model supports many to many relationship.
Question. Write an example of hierarchical database.
Answer. SYSTEM 2000 is an example of hierarchical database.
Question. Who developed Hierarchical model?
Answer. The Hierarchical model was developed by IBM in 1968.
Short Answer Type Questions-I
Question. What is relation? Define the relational
data model.
Answer. A relation is a table having atomic values, unique and
unordered rows and columns. The relational model represent data
and relationship among data by a collection of tables known as
relation, each of which has a number of columns with
unique names.
Question. Differentiate between cardinality and degree
of a table with the help of an example.
Answer. Cardinality is defined as the number of rows in a table.
Degree is the number of columns in a table. e.g. consider the
following table:
Question. What is table? Also, define Candidate Key.
Answer. A table consists of a number of rows and columns. Each
record contains values for the attributes. A candidate key is the
smallest subset of the super key for which there does not exist a
proper subset that is super key. In other words, all
attribute combinations inside a relation that can serve as primary
key are candidate keys.
Question. Differentiate between the primary key and
alternate key of a table with the help of an example.
Answer. A primary key is a value that can be used to identify a
unique row in a table. While an alternate key is any candidate key
which is not selected to be the primary key.
Example
So, Bank A/C Num and Aadhar Num are the
candidate keys for the table.
Primary key: Aadhar Num
Alternate key: Bank A/C Num
Question. Observe the following table carefully and write
the names of the most appropriate columns, which can be
considered as (i) candidate keys and (ii) primary key
Answer. Candidate keys : Id, Product
Primary key : Id
Question. Explain the concept of candidate keys with the
help of an appropriate example.
Answer. Candidate key is a column or set of columns that can
help in identifying records uniquely.
Example: consider a table STUDENT
Here, Admn No and Roll No define the table uniquely.
Hence, they are candidate keys.
Question. Define degree and cardinality. Based upon given
table write degree and cardinality.
Answer. Degree is the number of attributes or columns present
in a table.
Cardinality is the number of tuples or rows present in a table.
Degree: 4
Cardinality : 5 [2 marks for correct answer]
Question. Observe the following table and answer the
parts
(i) and (ii):
(i) In the above table, can we have Qty as primary key.
[Answer as Yes/No.]. Justify your answer.
(ii) What is the cardinality and degree of the above table?
Answer. (i) No. Because there is a duplication of values and
primary key value cannot be duplicate.
(ii) Degree : 4
Cardinality : 5
Question. A table CUSTOMER has 10 columns but no row.
Later, 10 new rows are inserted and 3 rows are deleted in
the table. What is the degree and cardinality of the table
CUSTOMER?
Answer. Degree = 10 (No. of columns)
Cardinality = 10 – 3 = 7 (no. of rows)
Question. Write some advantages of DBMS over file
system?
Answer. (i) No redundant data
(ii) Data security
(iii) Easy access to data
(iv) Data consistency and integrity
Question. Observe the table CLUB given below:
(i) What is the cardinality and degree of the given table?
(ii) If a new column Contact No is added and three more
members join the club then how these changes will affect
the degree and cardinality of the table.
Answer. (i) Cardinality : 4
Degree : 5
(ii) Cardinality : 7
Degree : 6
Long Answer Type Questions-I
Question. What is Hierarchical model?
Answer. The hierarchical model was developed by IBM in 1968.
The data is organised in a tree structure where the nodes
represent the records and the branches of the tree represent the
fields. Since the data is organized in a tree structure, the parent
node has the links to its child nodes. If we want to search a
record, we have to traverse the tree from the root through all its
parent nodes to reach the specific record. Thus, searching for a
record is very time consuming.
Question. Explain database.
Answer. A database is a collection of interrelated data. A
database consists of a number of tables. Each table comprises of
rows(records) and columns (attributes). Each record contains
values for the corresponding attributes. The values of the
attributes for a record are interrelated. For example,
different cars have different values for the same specifications
(length, color, engine capacity etc.)
Question. Explain network data model.
Answer. In network data model, the data is represented by
collection of records and relationship among data that are
represented by links like hierarchical data model. The only
difference is that in the network data model, records are
organized as arbitrary graphs rather than trees.
In this model, the parent child relationship is Many-to-Many i.e.,
one child segment can have multiple parent segments.
Long Answer Type Questions-II
Question. Define database management system.
Answer. A database management system (DBMS) is a set of
programs that enables the users to define, create and maintain
the database and provides controlled access to this database.
The primary goal of 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, searched, etc. using a DBMS, e.g. MySQL Ingress, MSAccess, Oracle, etc.
The purpose of a DBMS is to bridge the gap between the
information and data. The data stored in memory or on a disk
must be converted to usable information.
Question. What are keys? Name all the keys used in DBMS.
Answer. The key is defined as the column or attribute or a
combination of attributes that is used to identify records of the
database table. Sometimes we might have to retrieve data from
more than one table, in that case we require to join tables with
the help of keys. It also controls and maintains the integrity of
information stored in the database.
There are various types of keys, as
(i) Primary key
(ii) Candidate key
(iii) Alternate key
(iv) Foreign key
Question. What is the need of database system?
Answer. The need of database systems arose in the early 1960s,
in response to the traditional file processing system. In the file
processing system, the data is stored in the form of files and a
number of application programs are written by programmers to
add, modify, delete and retrieve data to and from appropriate
files. New application programs are added to the system as the
need arises.
Now, suppose a need arises to keep additional information about
the publishers of the books that include phone number and email
id. To fulfill this need, the system creates a new file PUBLISHER,
which includes name, address, phone number and e-mail id of
publishers. This gives rise to data redudancy, inconsistency,
unshareable data, insecured & incorrect data etc. A DBMS solves
all these problems.
Download