

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
101. |
The term _______ is used to refer to a row. |
A. | Attribute |
B. | Tuple |
C. | Field |
D. | Instance |
Answer» B. Tuple |
102. |
The term attribute refers to a ___________ of a table. |
A. | Record |
B. | Column |
C. | Tuple |
D. | Key |
Answer» B. Column |
103. |
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 |
104. |
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 |
105. |
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 |
106. |
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 |
107. |
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 |
108. |
The tuples of the relations can be of ________ order. |
A. | Any |
B. | Same |
C. | Sorted |
D. | Constant |
Answer» A. Any |
109. |
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 |
110. |
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 |
111. |
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 |
112. |
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 |
113. |
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) |
114. |
An attribute is a __________ in a relation. |
A. | Row |
B. | Column |
C. | Value |
D. | Tuple |
Answer» B. Column |
115. |
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 |
116. |
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 |
117. |
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 |
118. |
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 |
119. |
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 |
120. |
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) |
121. |
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( , …) |
122. |
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) |
123. |
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:); |
124. |
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 |
125. |
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 |
126. |
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 |
127. |
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. |
128. |
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 |
129. |
Which SQL function is used to count the number of rows in a SQL query? |
A. | COUNT() |
B. | NUMBER() |
C. | SUM() |
D. | COUNT(*) |
Answer» D. COUNT(*) |
130. |
Which SQL keyword is used to retrieve a maximum value? |
A. | MOST |
B. | TOP |
C. | MAX |
D. | UPPER |
Answer» C. MAX |
131. |
Which of the following SQL clauses is used to DELETE tuples from a database table? |
A. | DELETE |
B. | REMOVE |
C. | DROP |
D. | CLEAR |
Answer» A. DELETE |
132. |
___________removes all rows from a table without logging the individual row deletions. |
A. | DELETE |
B. | REMOVE |
C. | DROP |
D. | TRUNCATE |
Answer» D. TRUNCATE |
133. |
Which of the following is not a DDL command? |
A. | UPDATE |
B. | TRUNCATE |
C. | ALTER |
D. | None of the Mentioned |
Answer» A. UPDATE |
134. |
Which of the following are TCL commands? |
A. | UPDATE and TRUNCATE |
B. | SELECT and INSERT |
C. | GRANT and REVOKE |
D. | ROLLBACK and SAVEPOINT |
Answer» D. ROLLBACK and SAVEPOINT |
135. |
________________ is not a category of SQL command. |
A. | TCL |
B. | SCL |
C. | DCL |
D. | DDL |
Answer» B. SCL |
136. |
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default ______________ |
A. | ASC |
B. | DESC |
C. | There is no default value |
D. | None of the mentioned |
Answer» A. ASC |
137. |
Which of the following statement is true? |
A. | DELETE does not free the space containing the table and TRUNCATE free the space containing the table |
B. | Both DELETE and TRUNCATE free the space containing the table |
C. | Both DELETE and TRUNCATE does not free the space containing the table |
D. | DELETE free the space containing the table and TRUNCATE does not free the space containing the table |
Answer» A. DELETE does not free the space containing the table and TRUNCATE free the space containing the table |
138. |
What is the purpose of the SQL AS clause? |
A. | The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column |
B. | The AS clause is used with the JOIN clause only |
C. | The AS clause defines a search condition |
D. | All of the mentioned |
Answer» A. The AS SQL clause is used to change the name of a column in the result set or to assign a name to a derived column |
139. |
What does DML stand for? |
A. | Different Mode Level |
B. | Data Model Language |
C. | Data Mode Lane |
D. | Data Manipulation language |
Answer» D. Data Manipulation language |
140. |
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”? |
A. | SELECT * FROM Persons WHERE FirstName=’a’ |
B. | SELECT * FROM Persons WHERE FirstName LIKE ‘a%’ |
C. | SELECT * FROM Persons WHERE FirstName LIKE ‘%a’ |
D. | SELECT * FROM Persons WHERE FirstName=’%a%’ |
Answer» C. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’ |
141. |
With SQL, how can you return all the records from a table named “Persons” sorted descending by “FirstName”? |
A. | SELECT * FROM Persons SORT BY ‘FirstName’ DESC |
B. | SELECT * FROM Persons ORDER FirstName DESC |
C. | SELECT * FROM Persons SORT ‘FirstName’ DESC |
D. | SELECT * FROM Persons ORDER BY FirstName DESC |
Answer» D. SELECT * FROM Persons ORDER BY FirstName DESC |
142. |
With SQL, how can you return the number of not null records in the “Persons” table? |
A. | SELECT COUNT() FROM Persons |
B. | SELECT COLUMNS() FROM Persons |
C. | SELECT COLUMNS(*) FROM Persons |
D. | SELECT COUNT(*) FROM Persons |
Answer» D. SELECT COUNT(*) FROM Persons |
143. |
What does the ALTER TABLE clause do? |
A. | The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints |
B. | The SQL ALTER TABLE clause is used to insert data into database table |
C. | THE SQL ALTER TABLE deletes data from database table |
D. | The SQL ALTER TABLE clause is used to delete a database table |
Answer» A. The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints |
144. |
The UPDATE SQL clause can _____________ |
A. | update only one row at a time |
B. | update more than one row at a time |
C. | delete more than one row at a time |
D. | delete only one row at a time |
Answer» B. update more than one row at a time |
145. |
The UNION SQL clause can be used with _____________ |
A. | SELECT clause only |
B. | DELETE and UPDATE clauses |
C. | UPDATE clause only |
D. | All of the mentioned |
Answer» A. SELECT clause only |
146. |
Which SQL statement is used to return only different values? |
A. | SELECT DIFFERENT |
B. | SELECT UNIQUE |
C. | SELECT DISTINCT |
D. | SELECT ALL |
Answer» C. SELECT DISTINCT |
147. |
Which SQL keyword is used to sort the result-set? |
A. | ORDER BY |
B. | SORT |
C. | ORDER |
D. | SORT BY |
Answer» A. ORDER BY |
148. |
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table? |
A. | UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’ |
B. | MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’ |
C. | MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’ |
D. | UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’ |
Answer» D. UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’ |
149. |
Which of the following command makes the updates performed by the transaction permanent in the database? |
A. | ROLLBACK |
B. | COMMIT |
C. | TRUNCATE |
D. | DELETE |
Answer» B. COMMIT |
150. |
Which TCL command undo all the updates performed by the SQL in the transaction? |
A. | ROLLBACK |
B. | COMMIT |
C. | TRUNCATE |
D. | DELETE |
Answer» A. ROLLBACK |
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.