2. The term attribute refers to a ___________ of a table.
Correct : B. Column
3. For each attribute of a relation, there is a set of permitted values, called the ________ of
that attribute.
Correct : A. Domain
4. 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.
Correct : D. Schema, Instance
5. Course(course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
Correct : B. Attributes, Relation
6. 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.
Correct : C. Tuple of distinct
7. A domain is atomic if elements of the domain are considered to be ____________ units.
Correct : B. Indivisbile
8. The tuples of the relations can be of ________ order.
Correct : A. Any
9. Choose the correct statement regarding superkeys
Correct : A. A superkey is an attribute or a group of multiple attributes that can uniquely identify a tuple
10. What is an Instance of a Database?
Correct : C. The state of the database system at any given point of time
11. What is a foreign key?
Correct : C. A foreign key is an attribute of a relation that is a primary key of another relation
12. What action does ⋈ operator perform in relational algebra
Correct : A. Output specified attributes from all rows of the input relation and remove duplicate tuples from the output
13. What does the “x” operator do in relational algebra?
Correct : C. Output all pairs of rows from the two input relations (regardless of whether or not they have the same values on common attributes)
14. An attribute is a __________ in a relation.
Correct : B. Column
15. What is the method of specifying a primary key in a schema description?
Correct : D. By underlining it using a bold line
16. Statement 1: A tuple is a row in a relation
Statement 2: Existence of multiple foreign keys in a same relation is possible
Correct : A. Both the statements are true
17. Choose the option that correctly explains in words, the function of the following relational
algebra expression σyear≥2009 (book ⋈ borrow)
Correct : B. Selects all the tuples from the natural join of book and borrow wherever the year is lesser than 2009
18. State true or false: If a relation consists of a foreign key, then it is called a referenced
relation of the foreign key dependency.
Correct : B. False
19. Which of the following information does an SQL DDL not specify?
Correct : C. The operations on the tuples
20. Which of the following data types does the SQL standard not support?
Correct : B. String(n)
21. Which command is used to create a new relation in SQL
Correct : A. create table( , …)
22. 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?
Correct : D. foreign key(a1, a2)
23. What is the syntax to load data into the database? (Consider D as the database and a, b, c
as datA:)
Correct : B. insert into D values (a, b, C:);
24. Which of the following commands do we use to delete a relation (R) from a database?
Correct : A. drop table R
25. Which of the following commands do we use to delete all the tuples from a relation (R)?
Correct : C. delete from R
26. Choose the correct command to delete an attribute A from a relation R
Correct : C. It creates a relation with three attributes ownerID, ownername, floor in which ownerID cannot be null.
28. What does the notnull integrity constraint do?
Correct : C. It ensures that all tuples have a finite value on a specified attribute
29. Which SQL function is used to count the number of rows in a SQL query?
Correct : D. COUNT(*)
30. Which SQL keyword is used to retrieve a maximum value?
Correct : C. MAX
31. Which of the following SQL clauses is used to DELETE tuples from a database table?
Correct : A. DELETE
32. ___________removes all rows from a table without logging the individual row deletions.
Correct : D. TRUNCATE
33. Which of the following is not a DDL command?
Correct : A. UPDATE
34. Which of the following are TCL commands?
Correct : D. ROLLBACK and SAVEPOINT
35. ________________ is not a category of SQL command.
Correct : B. SCL
36. If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used
by default ______________
Correct : A. ASC
37. Which of the following statement is true?
Correct : A. DELETE does not free the space containing the table and TRUNCATE free the space containing the table
38. What is the purpose of the SQL AS clause?
Correct : 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
39. What does DML stand for?
Correct : D. Data Manipulation language
40. 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”?
Correct : C. SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
41. With SQL, how can you return all the records from a table named “Persons” sorted
descending by “FirstName”?
Correct : D. SELECT * FROM Persons ORDER BY FirstName DESC
42. With SQL, how can you return the number of not null records in the “Persons” table?
Correct : A. SELECT COUNT() FROM Persons
43. What does the ALTER TABLE clause do?
Correct : A. The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
44. The UPDATE SQL clause can _____________
Correct : B. update more than one row at a time
45. The UNION SQL clause can be used with _____________
Correct : A. SELECT clause only
46. Which SQL statement is used to return only different values?
Correct : C. SELECT DISTINCT
47. Which SQL keyword is used to sort the result-set?
Correct : A. ORDER BY
48. How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
Correct : D. UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
49. Which of the following command makes the updates performed by the transaction
permanent in the database?
Correct : B. COMMIT
50. Which TCL command undo all the updates performed by the SQL in the transaction?
Correct : A. ROLLBACK
51. SQL query to find all the cities whose humidity is 95.
Correct : B. SELECT city FROM weather WHERE humidity = 95
52. SQL query to find the temperature in increasing order of all cities.
Correct : D. SELECT city, temperature FROM weather ORDER BY city
53. What is the meaning of LIKE ‘%0%0%’?
Correct : D. Feature has two 0’s in it, at any position
54. Find the names of these cities with temperature and condition whose condition is neither
sunny nor cloudy.
Correct : A. SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
55. Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
Correct : C. SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
56. Find all the tuples having a temperature greater than ‘Paris’.
Correct : A. SELECT * FROM weather WHERE temperature > (SELECT temperature FROM weather WHERE city = ‘Paris’
57. Find all the cities with temperature, condition and humidity whose humidity is in the range
of 63 to 79.
Correct : C. SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79
58. The command to remove rows from a table ‘CUSTOMER’ is __________________
Correct : D. DELETE FROM CUSTOMER WHERE
59. What type of join is needed when you wish to include rows that do not have matching
values?
Correct : C. Outer join
60. What type of join is needed when you wish to return rows that do have matching values?
Correct : D. All of the Mentioned
61. Which of the following is one of the basic approaches for joining tables?
Correct : D. All of the Mentioned
62. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,
ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID?
Correct : A. Equi-join
63. A UNION query is which of the following?
Correct : C. Combines the output from multiple queries and must include the same number of columns
64. Which of the following statements is true concerning subqueries?
Correct : A. Involves the use of an inner and outer query
65. Which of the following is a correlated subquery?
Correct : A. Uses the result of an inner query to determine the processing of an outer query
66. The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID,
ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T?
Correct : D. Cartesian join
67. Which is not a type of join in T-SQL?
Correct : B. Natural join
68. What is a view?
Correct : B. A view is a virtual table which results of executing a pre-compiled query
69. Which of the following is not a limitation of view?
Correct : B. Index Created on View Used Often
70. Which of the following statement is true?
Correct : D. All of the Mentioned
71. SQL Server has mainly how many types of views?
Correct : B. two
72. Dynamic Management View is a type of ___________
Correct : A. System Defined Views
73. Syntax for creating views is __________
Correct : A. CREATE VIEW AS SELECT
74. You can delete a view with ___________ command.
Correct : A. DROP VIEW
75. What is SCHEMABINDING a VIEW?
Correct : B. These are stored only in the Master database
76. Which of the following is not a SQL Server INFORMATION_SCHEMA view?
Correct : D. sys.dm_exec_connections
77. ___________ is stored only in the Master database.
Correct : D. None of the mentioned
78. In the __________ normal form, a composite attribute is converted to individual attributes.
Correct : A. First
79. Tables in second normal form (2NF):
Correct : A. Eliminate all hidden dependencies
80. Which-one ofthe following statements about normal forms is FALSE?
Correct : C. Loss less, dependency – preserving decomposition into BCNF is always possible
81. Functional Dependencies are the types of constraints that are based on______
Correct : A. Key
82. Which is a bottom-up approach to database design that design by examining the relationship
between attributes:
Correct : C. Normalization
83. Which forms simplifies and ensures that there are minimal data aggregates and repetitive
groups:
Correct : C. 3NF
84. Which forms has a relation that possesses data about an individual entity:
Correct : C. 4NF
85. Which forms are based on the concept of functional dependency:
Correct : C. 3NF
86. Empdt1(empcode, name, street, city, state, pincode).
For any pincode, there is only one city and state. Also, for given street, city and state, there is just one pincode. In normalization terms, empdt1 is a relation in
Correct : B. 2 NF and hence also in 1 NF
87. We can use the following three rules to find logically implied functional dependencies.
This collection of rules is called
Correct : B. Armstrong’s axioms
88. Which of the following is not Armstrong’s Axiom?
Correct : C. Pseudotransitivity rule
89. The relation employee(ID,name,street,Credit,street,city,salary) is decomposed into
employee1 (ID, name)
employee2 (name, street, city, salary) This type of decomposition is called
Correct : D. None of the mentioned
90. Inst_dept (ID, name, salary, dept name, building, budget) is decomposed into
instructor (ID, name, dept name, salary) department (dept name, building, budget) This comes under
Correct : D. Both Lossy and Lossy-join decomposition
91. There are two functional dependencies with the same set of attributes on the left side of the arrow:
A->BC A->B
This can be combined as
Correct : A. A->BC
92. Consider a relation R(A,B,C,D,E) with the following functional dependencies:
ABC -> DE and
D -> AB The number of superkeys of R is:
Correct : C. 10
93. Which, if any, of the two queries above will correctly (in SQL2) get the desired set of
employee ID’s?
Correct : A. Both I and II
94. Suppose now that R(A,B:) and S(A,B:) are two relations with r and s tuples, respectively
(again, not necessarily distinct). If m is the number of (not necessarily distinct) tuples in the
result of the SQL query: R intersect S; Then which of the following is the most restrictive, correct condition on the value of m?
Correct : D. 0 <= m <= min(r,s)
95. Which of the following is not a key?
Correct : C. B, C
96. If a relation is in BCNF, then it is also in
Correct : D. All of the above
97. What action does ⋈ operator perform in relational algebra
Correct : A. Output specified attributes from all rows of the input relation and remove duplicate tuples from the output
98. Statement 1: A tuple is a row in a relation Statement 2: Existence of multiple foreign keys in a same relation is possible
Correct : A. Both the statements are true
99. The____condition allows a general predicate over the relations being joined.
Correct : A. On
100. Which of the join operations do not preserve non matched tuples?