Sunday, May 19, 2013

MySQL MCQ Test – 1


Que.1. BLOB data type can have default column value.
A.    True
B.     False

Right Answer: B

Que.2. User() function return the current user name and ___________
A.    password
B.     host name
C.    both a and b above
D.    database name associated with the user

Right Answer: B

Que.3. Can DISTINCT command be used for more than one column?
A.    No
B.     Yes

Right Answer: B

Que.4. How much storage space does DATETIME require?
A.    4 bytes
B.     2 bytes
C.    8 bytes
D.    1 bytes

Right Answer: C

Que.5. Which of the following file extension is valid MyISAM file extension?
A.    .ism
B.     .myd
C.    .my
D.    .mys

Right Answer: B

Que.6. –i-am-a-dummy flag is used Make the MySQL engine refuse UPDATE and which other command?
A.    WHERE
B.     INSERT
C.    DELETE
D.    TRUNCATE

Right Answer: C

Que.7. On executing DELETE command, if you get an error “foreign key constraint” – what does it imply?
A.    Foreign key not defined
B.     Table is empty
C.    Connectivity issue
D.    Data is present in the other table

Right Answer: D

Que.8.  Can I call  a trigger directly from an application?
A.    Yes
B.     No

Right Answer: B

Que.9. What is a candidate key?
A.    Used to uniquely identify a row
B.     Alias for primary key
C.    Used to identify a column
D.    Alias for foreign key

Right Answer: A

Que.10. Which is the default order of sort in ORDER BY clause?
A.    Ascending
B.     Descending

Right Answer: A

Que.11. Can I define multiple unique constraints on a table?
A.    Yes
B.     No

Right Answer: A

Que.12. How can we get the number of records or rows in a table?
A.    Using COUNT
B.     Using NUM
C.    Using NUMBER
D.    Both a and c above

Right Answer: A

Que.13. Which of the following ways below are the correct way to get the current date?
A.    SELECT CURTIME();
B.     SELECT CURDATE();
C.    SLELCT CURRRENT_TIME()
D.    All of the above

Right Answer: D

Que.14. USE keyword is used to select a ____________________
A.    Table
B.     Column
C.    Database
D.    All of the above

Right Answer: C

Que.15. How do I find out all databases starting with `test to which I have access to ?
A.    SHOW DATABASES LIKE `%test%`;
B.     SHOW DATABASES LIKE `%test;
C.    SHOW DATABASES LIKE `’test’%’;
D.    SHOW DATABASES LIKE `%test%’;

Right Answer: D

Que.16. A view is nothing but a _____________ table or a stored query.
A.    Dynamic
B.     Real
C.    Virtual
D.    Static

Right Answer: C

Que.17. When do we use a HAVING clause?
A.    To limit the output of  a query
B.     To limit the output of a query using an aggregate function only
C.    When GROUP by is used
D.    Both a and c above

Right Answer: B

Que.18. An outer join requires each record in the two joined tables to have a matching record
A.    True
B.     False

Right Answer: B

Que.19. Enum values are stored according to their index numbers
A.    True
B.     False

Right Answer: A

Que.20. If an ENUM column is declared NOT NULL, its   default value is the first element of the list of allowed values.
A.    True
B.     False, ENUM column cannot be null
C.    False, its default value is the last element of the list of allowed values

Right Answer: A

ORACLE MCQ Test – 1

Que.1. To determine the tome zone under which a database was operating
A.    select DBTIOMEZONE from root
B.    select TIMEZONE_DB from dual
C.    select DB_TIME_ZONE from dual
D.    select DBTIMEZONE from dual

Right Answer: D

Que.2. Can there be more than one datafile per tablespace?
A.    Yes
B.    No

Right Answer: A

Que.3. Where is the data dictionary kept?
A.    SYSTEM tablespace
B.    Stack Space
C.    Data file
D.    None of the above

Right Answer: A

Que.4. The size and content of the PGA is independent on the Oracle server options installed.
A.    True
B.    False

Right Answer: A

Que.5. Which area of PGA stores binding variables and runtime buffers information?
A.    SQL area
B.    Private SQL area
C.    Stack space
D.    Session area

Right Answer: B

Que.6. A database trigger is an alternative for
A.    Stored procedure
B.    Primary key for implementing referential integrity
C.    Foreign key for implementing referential integrity
D.    All of the above

Right Answer: C

Que.7. How many layers does the Oracle database have?
A.    1
B.    2
C.    3
D.    4

Right Answer: B

Que.8. Which type of index should be used on a fact table?
A.    A binary index
B.    A bitmap index
C.    A metadata index
D.    A database schema index

Right Answer:  B

Que.9. A data block is
A.    The place where all deleted records are persisted
B.    The largest logical storage unit ever available for any database block
C.    The smallest logical storage unit for a database object
D.    All of the above

Right Answer: C

Que.10. Which of the following statements regarding primary key is false?
A.    Primary key can have null values
B.    Primary key may contain duplicate values
C.    Primary key can not be applied for multiple columns
D.    All of the above

Right Answer: D

Que.11. The __________contains a set of tables and views that Oracle uses as a reference to the database.
A.    PGA
B.    Library cache
C.    Data dictionary
D.    SGA

Right Answer: A

Que.12. A ______________ is used to logically group data  together.
A.    Database
B.    Tablespace
C.    Datafiles
D.    Object

Right Answer: B

Que.13. What operator is used to prevent the error: `ORA-01427:single row sub query returns more than one row’?
A.    Use the IN operator
B.    Use the >= operator
C.    Use the CAN EXIST operator
D.    Use the = operator

Right Answer: A

Que.14. The redo log buffer and Shared pool are elements of ?
A.    PGA
B.    Buffer cache
C.    Both a and b
D.    SGA

Right Answer: D

Que.15. Indicate whether this statement is true or false. A foreign key column must contain unique values.
A.    True
B.    False

Right Answer: B

Que.16. Which of the following components comprise an oracle architecture?
A.    Database related background processes
B.    Tablespaces
C.    Datafiles
D.    All choices are correct

Right Answer: D

Que.17. What is the use of Library cache?
A.    Contains User information, such as user privileges
B.    Used to store shared SQL
C.    Log of changes made to the database
D.    All the choices are correct

Right Answer: B

Que.18. If the replication interval is smaller, there are few update conflicts
A.    True
B.    False

Right Answer: B

Que.19. Which of the following SQL operations demands the use of wild cards comparisons?
A.    IN
B.    BETWEEN
C.    EXISTS
D.    LIKE

Right Answer: D

Que.20. The basic memory structures associated with Oracle are the System Global Area (SGA) and the Program Global Area (PGA).
A.    True
B.    False

Right Answer: A