McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Computer Science Engineering (CSE) , Bachelor of Science in Computer Science FY (BSc CS) , Bachelor of Science in Computer Science SY (BSc CS) , Bachelor of Science in Information Technology SY (BSc IT) , Bachelor of Computer Applications (BCA) .
Chapters
1. |
Relational Algebra is a __________ query language that takes two relations as input and produces another relation as an output of the query. |
A. | Relational |
B. | Structural |
C. | Procedural |
D. | Fundamental |
Answer» C. Procedural |
2. |
For select operation the ________ appear in the subscript and the ___________ argument appears in the paranthesis after the sigmA:) |
A. | Predicates, relation |
B. | Relation, Predicates |
C. | Operation, Predicates |
D. | Relation, Operation |
Answer» A. Predicates, relation |
3. |
The ___________ operation, denoted by −, allows us to find tuples that are in one relation but are not in another. |
A. | Union |
B. | Set-difference |
C. | Difference |
D. | Intersection |
Answer» B. Set-difference |
4. |
In precedence of set operators, the expression is evaluated from |
A. | Left to left |
B. | Left to right |
C. | Right to left |
D. | From user specification |
Answer» B. Left to right |
5. |
Which one of the following is a set of one or more attributes taken collectively to uniquely identify a record? |
A. | Candidate key |
B. | Sub key |
C. | Super key |
D. | Foreign key |
Answer» C. Super key |
6. |
Consider attributes ID, CITY and NAME. Which one of this can be considered as a super key? |
A. | NAME |
B. | ID |
C. | CITY |
D. | CITY, ID |
Answer» B. ID |
7. |
A _____ is a property of the entire relation, rather than of the individual tuples in which each tuple is unique. |
A. | Rows |
B. | Key |
C. | Attribute |
D. | Fields |
Answer» B. Key |
8. |
An attribute in a relation is a foreign key if the _______ key from one relation is used as an attribute in that relation. |
A. | Candidate |
B. | Primary |
C. | Super |
D. | Sub |
Answer» B. Primary |
9. |
The relation with the attribute which is the primary key is referenced in another relation. The relation which has the attribute as a primary key is called ______________ |
A. | Referential relation |
B. | Referencing relation |
C. | Referenced relation |
D. | Referred relation |
Answer» C. Referenced relation |
10. |
The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation. |
A. | Referential relation |
B. | Referencing relation |
C. | Referenced relation |
D. | Referred relation |
Answer» C. Referenced relation |
11. |
A _________ integrity constraint requires that the values appearing in specified attributes
|
A. | Referential |
B. | Referencing |
C. | Specific |
D. | Primary |
Answer» A. Referential |
12. |
A relational database consists of a collection of |
A. | Tables |
B. | Fields |
C. | Records |
D. | Keys |
Answer» A. Tables |
13. |
A ________ in a table represents a relationship among a set of values. |
A. | Column |
B. | Key |
C. | Row |
D. | Entry |
Answer» C. Row |
14. |
The term _______ is used to refer to a row. |
A. | Attribute |
B. | Tuple |
C. | Field |
D. | Instance |
Answer» B. Tuple |
15. |
The term attribute refers to a ___________ of a table. |
A. | Record |
B. | Column |
C. | Tuple |
D. | Key |
Answer» B. Column |
16. |
For each attribute of a relation, there is a set of permitted values, called the ________ of that attribute. |
A. | Domain |
B. | Relation |
C. | Set |
D. | Schema |
Answer» A. Domain |
17. |
Database __________ which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time. |
A. | Instance, Schema |
B. | Relation, Schema |
C. | Relation, Domain |
D. | Schema, Instance |
Answer» D. Schema, Instance |
18. |
Course(course_id,sec_id,semester) Here the course_id,sec_id and semester are __________ and course is a _________ |
A. | Relations, Attribute |
B. | Attributes, Relation |
C. | Tuple, Relation |
D. | Tuple, Attributes |
Answer» B. Attributes, Relation |
19. |
Department (dept name, building, budget) and Employee (employee_id, name, dept name, salary) Here the dept_name attribute appears in both the relations. Here using common attributes in relation schema is one way of relating ___________ relations. |
A. | Attributes of common |
B. | Tuple of common |
C. | Tuple of distinct |
D. | Attributes of distinct |
Answer» C. Tuple of distinct |
20. |
A domain is atomic if elements of the domain are considered to be ____________ units. |
A. | Different |
B. | Indivisbile |
C. | Constant |
D. | Divisible |
Answer» B. Indivisbile |
21. |
The tuples of the relations can be of ________ order. |
A. | Any |
B. | Same |
C. | Sorted |
D. | Constant |
Answer» A. Any |
22. |
Choose the correct statement regarding superkeys |
A. | A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple |
B. | A superkey is a tuple or a set of multiple tuples that can uniquely identify an attribute |
C. | Every superkey is a candidate key |
D. | A superkey is an attribute or a set of attributes that distinguish the relation from other relations |
Answer» A. A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple |
23. |
What is an Instance of a Database? |
A. | The logical design of the database system |
B. | The entire set of attributes of the Database put together in a single relation |
C. | The state of the database system at any given point of time |
D. | The initial values inserted into the Database immediately after its creation |
Answer» C. The state of the database system at any given point of time |
24. |
What is a foreign key? |
A. | A foreign key is a primary key of a relation which is an attribute in another relation |
B. | A foreign key is a superkey of a relation which is an attribute in more than one other relations |
C. | A foreign key is an attribute of a relation that is a primary key of another relation |
D. | A foreign key is the primary key of a relation that does not occur anywhere else in the schema |
Answer» C. A foreign key is an attribute of a relation that is a primary key of another relation |
25. |
What action does ⋈ operator perform in relational algebra |
A. | Output specified attributes from all rows of the input relation and remove duplicate tuples from the output |
B. | Outputs pairs of rows from the two input relations that have the same value on all attributes that have the same name |
C. | Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes) |
D. | Return rows of the input relation that satisfy the predicate |
Answer» A. Output specified attributes from all rows of the input relation and remove duplicate tuples from the output |
26. |
What does the “x” operator do in relational algebra? |
A. | Output specified attributes from all rows of the input relation. Remove duplicate tuples from the output |
B. | Output pairs of rows from the two input relations that have the same value on all attributes that have the same name |
C. | Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes) |
D. | Returns the rows of the input relation that satisfy the predicate |
Answer» C. Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes) |
27. |
An attribute is a __________ in a relation. |
A. | Row |
B. | Column |
C. | Value |
D. | Tuple |
Answer» B. Column |
28. |
What is the method of specifying a primary key in a schema description? |
A. | By writing it in bold letters |
B. | By underlining it using a dashed line |
C. | By writing it in capital letters |
D. | By underlining it using a bold line |
Answer» D. By underlining it using a bold line |
29. |
Statement 1: A tuple is a row in a relation Statement 2: Existence of multiple foreign keys in a same relation is possible |
A. | Both the statements are true |
B. | Statement 1 is correct but Statement 2 is false |
C. | Statement 1 is false but Statement 2 is correct |
D. | Both the statements are false |
Answer» A. Both the statements are true |
30. |
Choose the option that correctly explains in words, the function of the following relational algebra expression σyear≥2009 (book ⋈ borrow) |
A. | Selects all tuples from the Cartesian product of book and borrow |
B. | Selects all the tuples from the natural join of book and borrow wherever the year is lesser than 2009 |
C. | Selects all the tuples from the natural join of book and student wherever the year is greater than or equal to 2009 |
D. | Selects all tuples from the Cartesian product of book and borrow wherever the year is greater than or equal to 2009 |
Answer» B. Selects all the tuples from the natural join of book and borrow wherever the year is lesser than 2009 |
31. |
State true or false: If a relation consists of a foreign key, then it is called a referenced relation of the foreign key dependency. |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» B. False |
32. |
Which of the following information does an SQL DDL not specify? |
A. | The schema for each relation |
B. | The integrity constraints |
C. | The operations on the tuples |
D. | The security and authorization information for each relation |
Answer» C. The operations on the tuples |
33. |
Which of the following data types does the SQL standard not support? |
A. | char(n) |
B. | String(n) |
C. | varchar(n) |
D. | float(n) |
Answer» B. String(n) |
34. |
Which command is used to create a new relation in SQL |
A. | create table( , …) |
B. | create relation( , …) |
C. | new table( , …) |
D. | new relation( , …) |
Answer» A. create table( , …) |
35. |
If a1, a2, a3 are attributes in a relation and S is another relation, which of the following is an incorrect specification of an integrity constraint? |
A. | primary key(a1, a2, a3) |
B. | primary key(a1) |
C. | foreign key(a1, a2) references S |
D. | foreign key(a1, a2) |
Answer» D. foreign key(a1, a2) |
36. |
What is the syntax to load data into the database? (Consider D as the database and a, b, c as datA:) |
A. | enter into D (a, b, C:); |
B. | insert into D values (a, b, C:); |
C. | insert into D (a, b, C:); |
D. | insert (a, b, C:) values into D; |
Answer» B. insert into D values (a, b, C:); |
37. |
Which of the following commands do we use to delete a relation (R) from a database? |
A. | drop table R |
B. | drop relation R |
C. | delete table R |
D. | delete from R |
Answer» A. drop table R |
38. |
Which of the following commands do we use to delete all the tuples from a relation (R)? |
A. | delete table R |
B. | drop table R |
C. | delete from R |
D. | drop from R |
Answer» C. delete from R |
39. |
Choose the correct command to delete an attribute A from a relation R |
A. | alter table R delete A |
B. | alter table R drop A |
C. | alter table drop A from R |
D. | delete A from R |
Answer» B. alter table R drop A |
40. |
create table apartment(ownerID varchar (5), ownername varchar(25), floor numeric(4,0),
|
A. | The statement is syntactically wrong |
B. | It creates a relation with three attributes ownerID, ownername, floor in which floor cannot be null. |
C. | It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null. |
D. | It creates a relation with three attributes ownerID, ownername, floor in which ownername must consist of at least 25 characters. |
Answer» C. It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null. |
41. |
What does the notnull integrity constraint do? |
A. | It ensures that at least one tuple is present in the relation |
B. | It ensures that at least one foreign key is present in the relation |
C. | It ensures that all tuples have a finite value on a specified attribute |
D. | It ensures that all tuples have finite attributes on all the relations |
Answer» C. It ensures that all tuples have a finite value on a specified attribute |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.