SQL/SQL MCQ SET 1 Sample Test,Sample questions

Question:
 0x61 + 0 results in _____________

1.0

2.'a'

3.97

4.arbitrary


Question:
'abc' || 'xyz', when PIPES_AS_CONCAT is enabled, results in ____________

1.0

2.1

3.abcxyz

4.xyzabc


Question:
A stored procedure is invoked using the statement __________

1.INVOKE

2.SEE

3.CALL

4.RETURN


Question:
Before MySQL 5.1.6 which privilege was required to create and drop triggers?

1.PRIVILEGE

2.TRIGGER

3.SUPER

4.MACRO


Question:
For the same input parameters, if the stored function returns the same result, it is called _____________

1.deterministic

2.non deterministic

3.regular

4.monotonous


Question:
For which of the following are triggers not supported?

1.delete

2.update

3.insert

4.views


Question:
How many values can be returned from a given stored function?

1.0

2.1

3.2

4.3


Question:
How many values can be returned from a stored procedure?

1.0

2.1

3.2

4.3


Question:
If a column is expected to store values up to 2 million, the best datatype for it is _____________

1.SMALLINT

2.TINYINT

3.MEDIUMINT

4.BIGINT


Question:
If an integer column is used for the values in range 1 to 99999, the best suitable datatype is ____________

1.MEDIUMINT SIGNED

2.MEDIUMINT UNSIGNED

3.SMALLINT SIGNED

4.SMALLINT UNSIGNED


Question:
If the PIPES_AS_CONCAT is disabled, 'abc' || 'xyz' results in ____________

1.1

2.0

3.error

4.-1


Question:
INT2 maps to MySQL type _____________

1.TINYINT

2.SMALLINT

3.MEDIUMINT

4.BIGINT


Question:
INT3 maps to MySQL type _____________

1.TINYINT

2.SMALLINT

3.MEDIUMINT

4.BIGINT


Question:
Suppose a stored function named PI() is written in the database sampdb. How would it be called?

1.PI()

2.sampdb.PI()

3.MySQL.PI()

4.db.PI()


Question:
The AUTO_INCREMENT column attribute is best used with which type?

1.FLOAT

2.INT

3.CHARACTER

4.DOUBLE


Question:
The creation of a stored program is similar to the definition of a _______________

1.Trigger

2.Event

3.View

4.Table


Question:
The default definer of an event is the user who _______________

1.created the database

2.created the event

3.created the table

4.created the column


Question:
The expression 12 DIV 5 evaluates to ____________

1.2.4

2.2

3.error

4.0


Question:
The expression 2 BETWEEN 2 AND 5 results in ____________

1.TRUE

2.FALSE

3.-1

4.2


Question:
The expression HI LIKE NULL results in _____________

1.TRUE

2.FALSE

3.NULL

4.0


Question:
To create or drop events for a database, which privilege should be granted?

1.CREATE

2.DROP

3.PRIVILEGE

4.EVENT


Question:
To produce a stored function, which statement is used?

1.PRODUCE FUNCTION

2.CREATE FUNCTION

3.PRODUCE PROCEDURE

4.CREATE PROCEDURE


Question:
What executes on a time activated basis according to a schedule?

1.Stored program

2.Events

3.Triggers

4.Stored procedures


Question:
What is abc in the following MySQL statement?

1.action

2.condition value

3.statement

4.null


Question:
What is abc in the following MySQL statement?

1.trigger name

2.table name

3.trigger statement

4.update statement


Question:
What produces result sets?

1.View

2.SELECT

3.Stored function

4.Trigger


Question:
When a user creates a stored program that accesses sensitive data but forgets that other people who can invoke the object have the same access, the security context is __________

1.good

2.bad

3.illegal

4.fare


Question:
When the security context enables carefully written stored programs to be set up that provide controlled access to tables for users, it is called __________

1.good

2.bad

3.illegal

4.fare


Question:
Which character does the mysql client program recognize as a statement delimiter?

1.Stored functions

2.Stored procedures

3.Triggers

4.Events


Question:
Which clause specifies periodic execution at fixed intervals?

1.EVERY

2.ALL

3.AT

4.ALTERNATE


Question:
Which command is used to redefined the mysql delimiter?

1.redefine_delim

2.delim_redefine

3.delimiter

4.redefine


Question:
Which datatype is best suited to store currency values?

1.INT

2.FLOAT

3.DOUBLE

4.DECIMAL


Question:
Which log does the event scheduler log to?

1.error

2.record

3.library

4.update


Question:
Which of the following is the correct order of precedence (high to low)?

1.!, ^, <<, XOR

2.^, !, <<, XOR

3.!, <<, XOR, ^

4.!, ^, XOR, <<


Question:
Which of the following lines is used to turn on the event scheduler?

1.event_scheduler = ON

2.eventscheduler = ON

3.event_scheduler_ON

4.events_scheduler_ON


Question:
Which of the following statements does not modify the table?

1.INSERT

2.UPDATE

3.DELETE

4.SELECT


Question:
Which of these is a stored program associated with a schedule?

1.Trigger

2.Event

3.Stored function

4.Stored procedure


Question:
Which of these is defined to execute when the table is modified only?

1.Stored functions

2.Stored procedures

3.Triggers

4.Events


Question:
Which of these return a result to the client?

1.Stored functions

2.Stored procedures

3.Triggers

4.Events


Question:
Which of these types store the longest length of strings?

1.CHAR

2.VARCHAR

3.TINYTEXT

4.TEXT


Question:
Which of these values is not valid as an AUTO_INCREMENT value?

1.0

2.1

3.2

4.3


Question:
Which privilege is enabled to create of alter a stored function?

1.SUPER

2.PRIOR

3.TOP

4.SUPERIOR


Question:
Which privilege must be given to the database to create a stored function or procedure?

1.CREATE ROUTINE

2.CREATE METHOD

3.CREATE FUNCTION

4.CREATE PROCEDURE


Question:
Which procedure parameter enables the caller to pass in a value and get back a value?

1.IN

2.OUT

3.INOUT

4.GETINOUT


Question:
Which statement is used to check the status of the event scheduler at runtime?

1.SHOW STATUS OF 'event_scheduler'

2.SHOW VARIABLES OF 'event_scheduler'

3.SHOW STATUS LIKE 'event_scheduler'

4.SHOW VARIABLES LIKE 'event_scheduler'


Question:
Which statement is used to create a trigger?

1.CREATE TRIGGER

2.CREATE TRIGGERS

3.PRODUCE TRIGGER

4.PRODUCE TRIGGERS


Question:
Which statement is used to remove a trigger?

1.REMOVE

2.DELETE

3.DROP

4.CLEAR


Question:
Which value of event_scheduler enables checking status but not changing it at runtime?

1.ON

2.OFF

3.DISABLED

4.ENABLED


Question:
Which variable is set to zero when automatic privilege granting is not needed?

1.automatic_sp_privileges

2.automatic_ps_privileges

3.automatic_pg_privileges

4.automatic_gp_privileges


More MCQS

  1. SQL MCQ SET 1
  2. SQL MCQ SET 2
  3. SQL MCQ SET 3
  4. SQL MCQ SET 4
  5. SQL MCQ SET 5
  6. SQL MCQ SET 6
  7. SQL MCQ SET 7
  8. SQL MCQ SET 8
  9. SQL MCQ SET 9
  10. SQL MCQ SET 10
  11. SQL MCQ SET 11
  12. SQL MCQ SET 12
  13. SQL MCQ SET 13
  14. SQL MCQ SET 14
  15. SQL MCQ SET 15
  16. SQL MCQ SET 16
  17. SQL MCQ SET 17
  18. SQL MCQ SET 18
  19. MCQ | SQL Basics
  20. MCQ | SQL Data Types
  21. SQL Server DBA Multiple Choice Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!