Untitled Document

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

1. Which SQL command is used to retrieve data from a database?

a. Insert
b. Delete
c. Select
d. Update
Ans(c.Select)

2. Which SQL Command is used to add a new column to an existing table?


a. ADD Column
b. New Column
c. Insert Column
d. Alter Table
Ans(d.Alter Table)

3. What is the default sort order of the ORDER BY clause?


a. DESC
b. ASC
c. RANDOM
d. NONE
Ans(b.ASC)

4. What does SQL stand for ?


a. Structured Quality Language
b. Simple Query Logic
c. Structured Query Language
d. System Query Language
Ans(c.Structured Query Language)

5. Which of the following is not a valid SQL data type?


a. Float
b. Char
c. Single
d. Decimal
Ans(c.Single)

6. How do you select all columns from a table named “Students”?


a. Select * INTO Students;
b. Select Students *;
c. Select ALL from Students;
d. Select * FROM Students;
Ans(d.Select * FROM Students;)

7. Which of the following is not an SQL aggregate function?


a. Count()
b. Max()
c. Concat()
d. Sum()
Ans(c.Concat())

8. Which keyword defines a primary key constraint on a table in MySQL?


a. Primary
b. Main
c. Unique
d. Primary Key
Ans(d.Primary Key)

9. What would be the result of the following SQL query: Select Upper(‘mysql’);?
a. Mysql
b. MYSQL
c. UPPER
d. None of the above
Ans(b.MYSQL)

10. Which SQL clause is used to specify a condition while fetching data from a table?
a. Decision
b. Check
c. Where
d. Condition
Ans(c.Where)

11. Which keyword would you use to rename a table in MySQL?


a. Rename
b. Rename Table
c. Alter
d. Change Table
Ans(b.Rename Table)

12. Which command is used to remove a specific row from a table?


a. Remove
b. Drop
c. Delete
d. Destroy
Ans(b.Drop)

13. Which SQL statement is used to update data in a database?


a. Refresh
b. Modify
c. Replace
d. Update
Ans(d.Update)

14. Which SQL function is used to round a number?


a. Round
b. RND
c. Circle
d. Loop
Ans(a.Round)

15. Which clause is used with the GROUP BY clause to filter grouped results in SQL?
a. Where
b. Order By
c. Having
d. Like
Ans(c.Having)

16. Which of the following is used to make a column’s value automatically increase for each
new record?
a. AUTOINCREMENT
b. AUTOADD
c. INCREMENTAL
d. ADDAUTO
Ans(a.AUTOINCREMENT)

17. Which SQL statement is used to access data from multiple tables based on a
relationship between certain columns?
a. Combine
b. Union
c. Join
d. Merge
Ans(c.Join)

18. What is the maximum length of a table name in MySQL?


a. 64 characters
b. 128 characters
c. 256 characters
d. 512 characters
Ans(A.64 characters)

19. Which MySQL function returns the smallest integer value not less than a number?
a. Ceiling()
b. Floor()
c. Roundup()
d. Top()
Ans(a.Ceiling())

20. Which storage engine in MySQL supports transactions?


a. MEMORY
b. MERGE
c. MyISAM
d. InnoDB
Ans(d.InnoDB)

21. A __________ is a special kind of a store procedure that executes in response to certain
action on the table like insertion, deletion or updation of data.
a. Procedures
b. Triggers
c. Functions
d. None of the mentioned
Ans(b.Triggers)

22. Triggers are not supported for


a. Delete
b. Update
c. Views
d. Insert
Ans(c.Views)

23. The variables in the triggers are declared using


a. –
b. @
c. /
d. @
Ans(b.@)

24. The default extension for an Oracle SQL*Plus file is:


a. a) .txt
b. b) .pls
c. c) .ora
d. d) .sql
Ans(d.sql)

25. Which of the following is NOT an Oracle-supported trigger?


a. BEFORE
b. DURING
c. AFTER
d. INSTEAD OF
Ans(b.During)

26. Point out the correct statement.


a. A Cursor is opened and populated by executing the SQL statement defined by
the cursor
b. After data manipulation, we should close the cursor explicitly
c. A cursor is declared by defining the SQL statement that returns a result set
d. All of the mentioned
Ans(d.All of the mentioned)

27. A dynamic cursor in SQL Server allows you to see __________ data.
a. Updated
b. Inserted
c. Deleted
d. All of the mentioned
Ans(d.All of the mentioned)

28. Which of the cursors further have their subtypes?


a. Static Cursors
b. Dynamic Cursors
c. Keyset Driven Cursors
d. None of the mentioned
Ans(d.None of the mentioned)

29. Which of the following FORWARD ONLY Cursor is populated at the time of creation?
a. KEYSET
b. FORWARD_ONLY STATIC
c. FAST_FORWARD
d. All of the mentioned
Ans(b.FORWARD_ONLY STATIC)

30. Life cycle of typical cursor involves ______ steps in SQL Server.
a. 2
b. 3
c. 4
d. 5
Ans(d.5)

31. Which of the following is not a limitation of view?


a. ORDER BY Does Not Work
b. Index Created on View Used Often
c. Cross Database Queries Not Allowed in Indexed View
d. Adding Column is Expensive by Joining Table Outside View
Ans(b.Index Created on View Used Often)
32. What is SCHEMABINDING a VIEW?
a. Schema binding binds your views to the dependent physical columns of the
accessed tables specified in the contents of the view
b. These are stored only in the Master database
c. These types of view are defined by users on a specified schema
d. These are used to show database self describing information
Ans(b.These are stored only in the Master database)

33. Which of the following is not a SQL Server INFORMATION_SCHEMA view?


a. INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
b. INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS
c. INFORMATION_SCHEMA.KEY_COLUMN_USAGE
d. Sys.dm_exec_connections
Ans(d.Sys.dm_exec_connections)

34. ___________ is stored only in the Master database.


a. Database-scoped Dynamic Management View
b. Complex View
c. Catalog View
d. None of the mentioned
Ans(c.Catalog View)

35. Which of the following creates a virtual relation for storing the query?
a. Function
b. View
c. Procedure
d. All of the mentioned
Ans(b.View)

36. Point out the correct statement.


a. Transaction ID Returns an object that can be used to specify configuration
options for a subsequent call to ITransactionJoin
b. COMMIT WORK syntax, with or without specifying the optional keyword WORK,
is compatible with SQL-92
c. You can use ROLLBACK WORK TRANSACTION to erase all data modifications
made from the start of the transaction
d. SQL-92 was the third revision of the SQL database query language
Ans(b.COMMIT WORK syntax, with or without specifying the
optional keyword WORK, is compatible with SQL-92)

37. __________ marks the end of a successful implicit or explicit transaction.


a. COMMIT TRANSACTION
b. ROLLBACK TRANSACTION
c. COMMIT WORK
d. All of the mentioned
Ans(a.COMMIT TRANSACTION)

38. rolls back a user-specified transaction to the beginning of the transaction.


a. ROLLBACK
b. ROLLBACK WORK
c. SAVE TRANSACTION
d. COMMIT
Ans(b.ROLLBACK WORK)

39. If @@TRANCOUNT is 1 ________ makes all data modifications performed since the
start of the transaction a permanent part of the database.
a. COMMIT TRANSACTION
b. SAVE TRANSACTION
c. ROLLBACK TRANSACTION
d. None of the mentioned
Ans(a.COMMIT TRANSACTION)

40. In _______ transaction we include the DML statements that need to be executed as a
unit.
a. Explicit
b. Implicit
c. Distributed
d. All of the mentioned
Ans(a.Explict)

41. A_____ is a query that retrieves rows from more than one table or view:
a) Start
b) End
c) Join
d) All of the mentioned
Ans( c)

42. Which view that contains more than one table in the top-level FROM clause of the
SELECT statement:
a) Join view
b) Datable join view
c) Updatable join view
d) All of the mentioned
Ans(c)

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


a) Equijoins
b) Cartesian
c) Both Equijoins and Cartesian
d) None of the mentioned
Ans(a)

44. Which are the join types in join condition:


a) Cross join
b) Natural join
c) Join with USING clause
d) All of the mentioned
Ans(d)

45. How many join types in join condition:


a) 2
b) 3
c) 4
d) 5
Ans(d)

46. Which join refers to join records from the write table that have no matching key in the left
table are include in the result set:
a) Left outer join
b) Right outer join
c) Full outer join
d) Half outer join
Ans(b)

47. CROSS JOIN and JOIN are similar to __________


a) INNER JOIN
b) NATURAL JOIN
c) OUTER JOIN
d) CARTESIAN JOIN
Ans(a)

48. In which join all the rows from the left table appear in the output irrespective of the
content of the other table?
a) RIGHT JOIN
b) LEFT JOIN
c) INNER JOIN
d) OUTER JOIN
Ans(b)

49. The join where all possible row combinations are produced is called _________
a) INNER JOIN
b) OUTER
c) NATURAL
d) CARTESIAN
Ans(d)

50. The left and right joins are also known as __________
a) INNER JOIN
b) NATURAL JOIN
c) OUTER JOIN
d) CARTESIAN JOIN
Ans(c)

51. The string function that returns the index of the first occurrence of substring is
_____________
a) INSERT()
b) INSTR()
c) INSTRING()
d) INFSTR()
Ans(b)
52. Which of the following is the standard format the MySQL displays DATE values.
A. YYYY-MM-DD
B. DD-MM-YYYY
C. YY-MM-DD
D. MM-DD-YYYY
Ans (A)

53. The … attribute of MySQL data type is used to guarantee uniqueness for a given row.
A. UNIQUE
B. UNIQUE KEY
C. KEY
D. PRIMARY KEY
Ans(D)

54. The … data type offers MySQL’s fixed-length string representation, supporting a
maximum length of 255 characters.
A. TEXT
B. CHAR
C. FIXEDCHAR
D. TINYCHAR
Ans(B)

55. For all date and time data types, MySQL will accept any type of … delimiter to separate
the various date and time values.
A. numeric
B. alphanumeric
C. nonalphanumeric
D. nonnumeric
Ans(C.)

56. The … attribute used in MySQL data type is offered as an aid in the database
compatibility.
A. DEFAULT
B. INDEX
C. NATIONAL
D. NULL
Ans(C)

57. MySQL requires that the … attribute be used in conjunction with column designated as
the primary key.
A. COLUMN_KEY
B. AUTO_INCREMENT
C. PRIMARY_KEY
D. UNIQUE_KEY
Ans(B)

You might also like