Transcript
Page 1: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 1 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

TRB – POLYTECHNIC LECTURER - 2020

SUBJECT / TOPICS: COMPUTER SCIENCE – UNIT - 5

DATABASE CONCEPT - II

TIME: 1 HR MARKS: 80

1. Which of the following is not a built in aggregate function in SQL?

(A) avg (B) max (C) total (D) count

2. We apply the aggregate function to a group of sets of tuples using the __________

clause

(A) group by (B) group (C) group set (D) group attribute

3. The ____________ aggregation operation adds up all the values of the attribute

(A) add (B) avg (C) max (D) sum

4. What values does the count(*) function ignore?

(A) Repetitive values (B) Null values

(C) Character (D) None of these.

5. 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

6. Which SQL keyword is used to sort the result-set ?

(A) ORDER BY (B) SORT (C) ORDER (D) SORT BY

FUTURE VISION STUDY CENTRE 2

ndFloor , Avk Maruthi Plaza, Opp: Hotel Lakshmi Prakash,

SKS Hospital Road, New Bus Stand, Salem.Contact :90420 30163

WWW.FUTUREVISIONTNPSC.COM

Page 2: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 2 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

7. Which of the following command makes the updates performed by the transaction

permanent in the database?

(A) ROLLBACK (B) COMMIT (C) TRUNCATE (D) DELETE

8. The command to remove rows from a table „CUSTOMER‟ is

a) DROP FROM CUSTOMER b) UPDATE FROM CUSTOMER

c) REMOVE FROM CUSTOMER d) DELETE FROM CUSTOMER WHERE

9. Aggregate functions are functions that take a ____ as input and return a single value.

a) Collection of values b) Single value

c) Double value d) All of the mentioned

10. If we do want to eliminate duplicates, we use the keyword __________in the

aggregate expression.

(A) Distinct (B) Count (C) Avg (D) Primary key

11. Which of the following is not a aggregate function?

(A) Avg (B) Sum (C) With (D) Min

12. Match the following:

(A) ALTER - (i) ER Model

(B) Delete - (ii) Relationship model

(C) Diamond - (jii) Data Definition Language.

(D) Record - (iv) Data Manipulation Language.

(a) (iii) (iv) (i) (ii) (b) (iii) (iv) (ii) (i)

(c) (iv) (iii) (i) (ii) (d) (iv) (iii) (ii) (i)

13. A relation scheme is said to be in ___________ form if the values in the domain of

each attribute of the relation are atomic.

(A) Unnormalized (B) First Normal (C) Boyce codd (D) None.

14. Match the following:

(A) UPDATE - (i) DDL

(B) REVOKE - (ii) TCL

(C) DROP - (jii) DML

(D) ROLLBACK - (iv) DCL

(a) (iii) (iv) (ii) (i) (b) (iii) (iv) (i) (ii)

(c) (iii) (ii) (i) (iv) (d) (iv) (iii) (ii) (i)

15. An Un normalized relation contains values _____________

(A) Atomic (B) Non-atomic (C) classified (D) None.

Page 3: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 3 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

16. Which operator is used to compare a value to list of literals values that have been

specified?

(A) BETWEEN (B) IN (C) Like (D) COMPARE.

17. Match the following:

(A) INSERT - (i) DDL

(B) GRANT - (ii) TCL

(C) TRUNCATE - (jii) DML

(D) COMMIT - (iv) DCL

(a) (iii) (ii) (i) (iv) (b) (iii) (iv) (ii) (i)

(c) (iii) (iv) (i) (ii) (d) (iv) (iii) (ii) (i)

18. Which of the following is not a type of SQL statement?

(A) Data Manipulation Language (DML)

(B) Data Definition Language (DDL)

(C) Data Control Language (DCL)

(D) Data Communication Language (DCL).

19. In SQL, which of the following is not a DML command?

A. Delete B. Truncate C. Update D. Create.

20. Match the following:

(A) DDL - (i) ALTER

(B) DML - (ii) SELECT

(C) DCL - (jii) REVOKE

(D) TCL - (iv) ROLLBACK

(a) (i) (ii) (iii) (iv) (b) (i) (ii) (iv) (iii)

(c) (i) (iii) (iv) (ii) (d) (iv) (iii) (ii) (i)

21. Which of the following is not included in DML?

(A) INSERT (B) UPDATE (C) DELETE (D) CREATE

22. TRUNCATE statement in SQL is a _________________

A. DML statement B. DDL statement C. DCL statement D. TCL Stmt.

23. A type of Query that is placed within a WHERE (or) HAVING clause of another query

is called _____________

A. Master Query B. Sub query C. Super query D. Multi query.

Page 4: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 4 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

24. In an SQL statement, which of the following parts states the condition for row

selection?

A) Where B) from C) Order by D) Group By

25. A transaction completes its execution is said to be _____________

A) Committed B) Aborted C) Rolled back D) failed.

26. Which of the following keyword is used with Data Control Language (DCL)

statements?

A. SELECT B. INSERT C. DELETE D. GRANT

27. The Database Language that allows you to Access (or) Maintain Data in a Database

A. DCL B. DML C. DDL D. All of Mentioned

28. A Database language concerned with the definition of the whole Database structure

and schema is _______________

(A) DCL (B)DML (C)DDL (D) All of the mentioned.

29. Which command is used to remove a table from the database in SQL?

(A) Delete (B) Drop table (c) Erase table (D) None.

30. What is the meaning of “SELECT” clause in MySQL?

a) Show me all Columns and rows b) Show me all columns

c) Show me all rows d) None of the mentioned

31. Which clause is mandatory with clause “SELECT” in MySQL?

a) FROM b) WHERE

c) Both FROM and WHERE d) None of the mentioned

32. What will be the output of a query given below?

SELECT * FROM person

WHERE person id = 1;

a) Show all columns but only those rows which belongs to person id=1

b) Show all columns and rows

c) Shows only columns person id

d) None of the mentioned

Page 5: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 5 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

33. What is „abc‟ in the following statement?

SELECT xyz FROM abc;

a) row name b) column name c) table name d) database name

34. Which clause is used to sort query elements?

a) GROUP b) GROUP BY c) ORDER d) ORDER BY

35. The number of attributes in the following table is ______________

CREATE TABLE employee (emp name CHAR (30), emp id INT);

a) 30 b)1 c) 2 (d) 3

36. Which among the following is the correct syntax for creating table?

a) CREATE TABLE name; b) CREATE name;

c) CREATE TABLE d) All of the mentioned

37. Which statement is used to delete an existing row from the table?

a) DELETE b) WHERE c) MODIFY d) None of the mentioned

38. SQL developed in the year ________________

A. 1980 B. 1970 C. 1977 D.1987

39. Who is SQL developer?

A. Raymond FF Boyce B. FF.Batya C. Laurence D. FF. Boyce codd

40. Which of the following set of keywords constitutes a mapping in SQL?

(a) SELECT, FROM, TABLE (b) SELECT, FROM, WHERE

(c) CONNECT, TABLE, CREATE (d) SELECT, TABLE, INSERT

41. Which of the following is true regarding Null value?

(a) Null < 0 (b) Null = 0 (c) Null<>0 (d) Null >0

42. Relational Algebra is a __________ query language that takes two relation as input

and produces another relation as output of the query.

(a) Relational (b) Structural (c) Procedural (d) Fundamental

Page 6: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 6 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

43.Which of the following is a fundamental operation in relational algebra?

(a) Set intersection (b) Natural join

(c) Assignment (d) None of the mentioned.

44. Which of the following is used to denote the selection operation in relational

algebra?

(a) Pi (Greek) (b) Sigma (Greek) (c) Lambda (Greek) (d) Omega (Greek)

45. 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

46. Which is a join condition contains an equality operator:

(a) Equijoins (b) Cartesian (c) Natural (d) Left

47. Cartesian product in relational algebra is ___________

(a) a Unary operator (b) a Binary operator

(c) a Ternary operator (d) not defined.

48. In an E-R diagram an entity set is represent by a ___________

(a) Rectangle (b) Ellipse (c) Diamond box (d) Circle.

49. Count function in SQL returns the number of ___________

(a) values (b) distinct values (c) groups (d) columns.

50. It is possible to define a schema completely using

(a) VDL and DDL (b) DDL and DML

(c) SDL and DDL (d) VDL and DML

51. Which of the following operation is used if we are interested in only certain columns

of a table?

(a) Projection (b) Selection (c) Union (d) Join.

Page 7: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 7 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

52. Which of the following is a legal expression in SQL?

(a) SELECT NULL FROM EMPLOYEE;

(b) SELECT NAME FROM EMPLOYEE;

(c) SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL;

(d) None of the above.

53. Which of the operations constitute a basic set of operations for manipulating

relational data?

(a) Predicate calculus. (b) Relational calculus.

(c) Relational algebra (d) None of the above.

54. The natural join is equal to:

(a) Cartesian Product.

(b) Combination of Union and Cartesian product.

(c) Combination of Selection and Cartesian product.

(d) Combination of Projection and Cartesian product.

55. The __________ operator is used to compare a value to a list of literals values that

have been specified.

(a) BETWEEN (b) ANY (c) IN (d) ALL

56. ___________ function divides one numeric expression by another and returns the

remainder.

(a) POWER (b) MOD (c) ROUND (d) REMAINDER.

57. A file manipulation command that extracts some of the records from a file is called

________________

(a) SELECT (b) PROJECT (c) JOIN (d) PRODUCT

58. Which operator performs pattern matching?

(a) BETWEEN operator (b) LIKE operator

(c) EXISTS operator (d) None of these

59. Which of the following is a comparison operator in SQL?

(a) = (b) LIKE (c) BETWEEN (d) ALL

Page 8: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 8 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

60. Which of the following is a valid SQL type?

(a) CHARACTER (b) NUMERIC (c) FLOAT (d) All of the above.

61. What operator tests column for the absence of data?

(a) EXISTS operator (b) NOT operator

(c) IS NULL operator (d) None of these

62. In SQL, which of the following is not a data definition language commands?

(a) RENAME (b) REVOKE (c) GRANT (d) UPDATE

63. In SQL, which command is used to SELECT only one copy of each set of duplicate

rows.

(a) SELECT DISTINCT (b) SELECT UNIQUE

(c) SELECT DIFFERENT (d) All of the above.

64. Which of the following SQL commands is used to retrieve data?

(a) DELETE (b) INSERT (c) SELECT (d) JOIN

65. Which SQL keyword is used to sort the result-set?

(a) SORT BY (b) ORDER (c) ORDER BY (d) SORT

66. The SQL statement SELECT ROUND (45.926,-1) FROM DUAL;

(a) is illegal (b) prints garbage (c) prints 045.926 (d) prints 50

67. Which of the following command makes the updates performed by the transaction

permanent in the database?

(a) ROLLBACK (b) COMMIT (c) TRUNCATE (d) DELETE

68. Find all the cities whose humidity is 89

(a) SELECT city WHERE humidity = 89;

(b) SELECT city FROM weather WHERE humidity = 89;

(c) SELECT humidity = 89 FROM weather;

(d) SELECT city FROM weather;

Page 9: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 9 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

69. Find the temperature in increasing order of all cities

(a) SELECT city FROM weather ORDER BY temperature;

(b) SELECT city, temperature FROM weather;

(c) SELECT city, temperature FROM weather ORDER BY temperature;

(d) SELECT city, temperature FROM weather ORDER BY city;

70. If a query involves NOT, AND, OR with no parenthesis

(a) NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last.

(b) NOT will be evaluated first; OR will be evaluated second; AND will be evaluated last.

(c) AND will be evaluated first; OR will be evaluated second; NOT will be evaluated last.

(d) The order of occurrence determines the order of evaluation.

71. Let the statement

SELECT column1 FROM myTable;

Return 10 rows. The statement

SELECT ALL column1 FROM myTable;

will return

(a) less than 10 rows (b) more than 10 rows

(c) exactly 10 rows (d) None of these

72. The command to remove rows from a table „ CUSTOMER‟ is:

(a) DROP FROM CUSTOMER

(b) UPDATE FROM CUSTOMER

(c) REMOVE FROM CUSTOMER

(d) DELETE FROM CUSTOMER WHERE

73. The SQL WHERE clause:

(a) limits the row data are returned.

(b) Limits the column data that are returned.

(c) Both A and B are correct.

(d) Neither A nor B are correct.

74. Which of the following is the original purpose of SQL?

(a) To define the data structures

(b) To specify the syntax and semantics of SQL data definition language.

(c) To specify the syntax and semantics of SQL manipulation language.

(d) All of the above.

Page 10: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 10 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

75. The SQL keywords ___________ is used with wildcards.

(a) NOT IN only (b) LIKE only (c) IN only (d) IN and NOT IN

76. A subquery in an SQL SELECT statement is enclosed in:

(a) parenthesis –(…). (b) brackets -- [….].

(c) CAPITAL LETTERS. (d) braces – {…..}.

77. The HAVING clause does which of the following?

(a) Acts EXACTLY like a WHERE clause

(b) Acts like a WHERE clause but is used for columns rather than groups.

(c) Acts like a WHERE clause but is used for groups rather than rows.

(d) Acts like a WHERE clause but is used for rows rather than columns.

78. The SQL keyword BETWEEN is used:

(a) to limit the columns displayed.

(b) for ranges.

(c) as a wild card

(d) None of these.

79. Which of the following query is correct for using comparison operators in SQL?

(a) SELECT name, course name FROM student WHERE age>50 and <80;

(b) SELECT name, course name FROM student WHERE age>50 and age <80;

(c) SELECT name, course name FROM student WHERE age>50 and WHERE age<80;

(d) None of these.

80. How to select all data from student table starting the name from letter „r‟?

(a) SELECT * FROM student WHERE name LIKE „r%‟;

(b) SELECT * FROM student WHERE name LIKE „%r%‟;

(c) SELECT * FROM student WHERE name LIKE „%r‟;

(d) SELECT * FROM student WHERE name LIKE „_r%‟;

.

Page 11: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 11 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

Page 12: FUTURE VISION STUDY CENTREfuturevisiontnpsc.com/uploads/info_txt/UNIT-5_-_TRB_CS-_DATA_CO… · 21. Which of the following is not included in DML? (A) INSERT (B) UPDATE (C) DELETE

TRB - POLY – CS ~ 12 ~ UNIT-5

FUTURE VISION STUDY CENTRE – SALEM CONTACT : 90420 30163

ANSWER KEY:

DATABASE CONCEPT - II

1 2 3 4 5 6 7 8 9 10

C A D B D A B D A A

11 12 13 14 15 16 17 18 19 20

C A B B B C B D B A

21 22 23 24 25 26 27 28 29 30

D B B A A D A C B A

31 32 33 34 35 36 37 38 39 40

A A C D C A A B A B

41 42 43 44 45 46 47 48 49 50

C C D B B A B A A B

51 52 53 54 55 56 57 58 59 60

A B C D A B A B D D

61 62 63 64 65 66 67 68 69 70

C D A C C D B B C A

71 72 73 74 75 76 77 78 79 80

C D A D B A C B B A