Contents
Chapterwise Question Bank CBSE Class 12 Computer Science (C++) – Database Concepts
Exam Practice
Short Answer Type Questions [2 Marks]
Question 1:
What is the difference between degree and cardinality of a table? What is the degree and cardinality of the following table? Delhi 2013
Differentiate between the terms degree and cardinality in context of RDBMS. Delhi 2008C
Answer:
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.
Question 2:
Explain the concept of candidate keys with the help of an appropriate example. All India 2013
Or
What are candidate keys in a table? Give a suitable example of candidate keys in a table. Delhi 2009, 2010
Answer:
Candidate key A candidate key is a set of one or more fields that identifies each record uniquely in a table. There can be multiple candidate keys in one table. Each candidate key can work as primary key.
In the Item table, INo and IName can be treated as the candidate keys.
Question 3:
Give suitable example of a table with sample data and illustrate primary and candidate keys in it. Delhi 2012
Or
Differentiate between candidate key and primary key in context of RDBMS. Delhi 2008
Answer:
The candidate key is a set of attributes that uniquely identifies records in a table. Each table may have one or more candidate keys.
Primary key The candidate key that is selected to identify tuples uniquely in a relation is called a primary key. A relation can have only one primary key.
In Student table, AdmNo and RollNo both can identify records uniquely. So, both are candidate key. Here, we have created AdmNo as primary key
Question 4:
How tuple is differ from an attribute in a relation? Define relation also.
Answer:
Relation
A relation is a table with columns and rows, which represent the data items and relationships among them. Relations have three important properties as a name, a cardinality and a degree. These properties help us to further define and describe relations:
(i) Name The first property of a relation is its name, which is represented by the title or the entity identifier.
(ii) Cardinality The second property of a relation is its cardinality, which refers to the number of tuples (rows) in a relation.
(iii) Degree The third property of a relation is its degree, which refers to the number of attributes (columns) in each tuple.
Question 5:
Explain the concept union between two tables, with the help of appropriate example. Delhi 2014
Answer:
In database management system, union of two tables is simply a set operation. While performing union operation on two tables the records, which are common in both the tables appear once in the resultant table and all the other records from both the tables are also included in the resultant relation. For performing union between two tables both the tables must be union compatible.
Tables are said to be union compatible, if:
(i) Both the tables are of same degree.
(ii) The domains of corresponding attributes in both the tables should be same.
e.g. consider the following two tables Course 1 and Course2
Question 6:
Illustrate cartesian product operation between the two tables/relations using a suitable example. Delhi 2012C
Or
Explain the concept of cartesian product between two tables, with the help of appropriate example. All India 2014
Answer:
The cartesian product of two relations R and S is the relation, which is a concatenation of every tuple of relation R with every tuple of relation S. e.g. consider the following two tables GABS1 and GABS 2
Question 7:
What do you mean by union and cartesian product operation in relational algebra? Delhi 2011
Answer:
Union It operates on two relations and is indicated by ∪. e.g. R = R1 ∪ R2 represents union operation between two relations R1 and R2. The degree of R is equal to degree of RI. The cardinality of R is equal or less than the sum of cardinality of R1 and cardinality of R2.
Cartesian product It operates on two relations and is denoted by x . e.g. cartesian product of two relations R1 and R2 is represented by R = R1 x R2. The degree of R is equal to sum of degrees of R1 and R2. The cardinality of R is product of cardinality of R1 and cardinality of R2.
Question 8:
What do you understand by selection and projection operation in relational algebra? All India 2011
Answer:
Question 9:
What are primary and alternate key in a database? Give suitable example to explain each. Delhi 2011C
Or
Give a suitable example of a table with sample data and illustrate primary and alternate keys in it. All India 2012
Answer:
Primary key It is a column or set of columns which helps to identify row uniquely, e.g. in table Student, RollNo of all students are different So, RollNo, is a primary key, helps to identify the information of all students uniquely.
Alternate key It is a column or set of columns that can act as a primary key but not selected as a primary key.
e.g. In table Student, RollNo and AdmNo of all students are different. Both of them can be selected as a primary key. Suppose, we have selected roll number as a primary key then AdmNo is called as alternate key.
Question 10:
A database is storing the information about teacher and its related topic. If the following are in the school:
For each teacher the address of the teacher is also present in the database and for each topic to which subject it belongs. The database also contain which teacher takes how many classes. Draw a relational view for above data.
Answer:
The Relational view of above data is:
Question 11:
What do you understand by primary key? Give a suitable example of primary key from a table containing some meaningful data. All India 2010,2009
Answer:
A primary key is a set of one or more attributes that can uniquely identify tuples within the relation.
The attribute ItemNo is a primary key in ITEM table as it contains unique value for each tuple in a relation.
Question 12:
Consider the following two tables:
Perform the STUDENTS ∪ VIDHYARTHI operation on above relation and show the resultant relation.
Answer:
Question 13:
Consider the following Supplier table:
Write a query to find all suppliers, who reside in Noida and also give the resultant table.
Answer:
To find all suppliers who reside in Noida
Question 14:
What is the need of normalisation?
Or
What do you understand by normalisation?
Answer:
Normalisation
The normalisation is the process of transformation of the relationship among data elements in a record. Normalisation replaces a collection of data in a record structure by another record design which is simpler, more predictable and therefore more manageable.
Some important form of normalisation are:
(i) First Normal Form
(ii) Second Normal Form
(iii) Third Normal Form
Question 15:
Define the following terms:
(i) First Normal Form
(ii) Second Normal Form
(iii) Third Normal Form
Answer:
Normalisation
The normalisation is the process of transformation of the relationship among data elements in a record. Normalisation replaces a collection of data in a record structure by another record design which is simpler, more predictable and therefore more manageable.
Some important form of normalisation are:
First Normal Form (1NF)
Any table is in INF if the values in the domain of each attribute of the relation are “atomic”. We can say, only one value is associated with each attribute and the value is not a set of values or a list of values. It does not have any repeating groups. It disallow multi-valued attributes, composite attributes and their combinations.
Second Normal Form (2NF)
To be in 2NF, a table must be in First Normal Form and no attributes of the table should be functionally dependent on only one part of a concatenated primary key. Thus, 2NF can be violated only when a key is a composite key, or in„.other words, one that consists of more than one attributes.
Third Normal Form (3NF)
A table is said to be in the 3NF, if all the non-key fields of the table are independent of all other non-key fields of the table.
Question 16:
Consider the following relations
Teach (Name, Address, Course)
Give an expression in the relational algebra for each of the following:
(i) Print all the information about teachers who are teaching the ‘DBMS’ course.
(ii) Print the names and addresses of those teachers who teach ‘computer’.
(iii) List all the teachers who live in Mumbai.
Answer:
Question 17:
A database is to contain information about person and skills. At a particular time the following persons are represented in the database, and their skills are as indicated
For each person, the database contains several details like Mobile number, Address. For each skill it contains an identification of the appropriate skill and other information. Draw a relational view for this data.
Answer:
Question 18:
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:
(i) Candidate Keys CID, ITEM
(ii) Primary key CID
Computer ScienceChapterwise Question Bank for Computer ScienceNCERT Solutions