Database - Sql - Sql Question And Answers

Which of the following is not a character manipulation function?

A.  concat

B.  substr

C.  instr

D.  coalesce

View Answer  

A view is nothing but a ________ table or a stored query

A.  Dymanic

B.  Real

C.  Virtual

D.  Static

View Answer  

Which of the following file extension is a valid MyISAM file extension?

A.  .ism

B.  .myd

C.  .my

D.  .mys

View Answer  

An outer join requires each record in the two joined tables to have a matching record.

A.  True

B.  False

C.  None

D.  Both

View Answer  

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

View Answer  

Can I call a trigger directly called from an application?

A.  Yes

B.  No

C.  

D.  

View Answer  

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

D.  Both b and c

View Answer  

Which of the following is NOT available in MySQL?

A.  FETCH

B.  REVOKE

C.  LIKE

D.  JOIN

View Answer  

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%’;

View Answer  

How much storage space does DATETIME require?

A.  4 bytes

B.  2 bytes

C.  8 bytes

D.  1 byte

View Answer  

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 b and c above

View Answer  

Which of the following ways below are the correct way to get the current date?

A.  SELECT CURTIME();

B.  SELECT CURDATE();

C.  SELECT CURRENT_TIME();

D.  All of above

View Answer  

User() fucntion returns the current users user name and ___________

A.  password

B.  host name

C.  both a and b above

D.  database name associated with the user

View Answer  

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

View Answer  

Can DISTINCT command be used for more than one column?

A.  No

B.  Yes

C.  

D.  

View Answer  

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

View Answer  

BLOB data type can have default column value.

A.  True

B.  False

C.  

D.  

View Answer  

Can I define multiple unique constraints on a table?

A.  Yes

B.  No

C.  

D.  

View Answer  

Which is the default order of sort in ORDER BY clause?

A.  Ascending

B.  Descending

C.  

D.  

View Answer  

USE keyword is used to select a ___________

A.  Table

B.  Column

C.  Database

D.  All of above

View Answer  

Enum values are stored according to their index numbers

A.  True

B.  False

C.  

D.  

View Answer  

MySQL runs on which operating systems?

A.  Linux and Mac OS-X only

B.  Any operating system at all

C.  Unix, Linux, Windows and others

D.  Unix and Linux only

View Answer  

To remove duplicate rows from the result set of a SELECT use the following keyword:

A.  NO DUPLICATE

B.  UNIQUE

C.  DISTINCT

D.  None of the above

View Answer  

Which of the following can add a row to a table?

A.  Add

B.  Insert

C.  Update

D.  Alter

View Answer  

To use MySQL on your computer, you'll need?

A.  FTP and Telnet

B.  Some sort of client program to access the databases

C.  A Browser

D.  Perl, PHP or Java

View Answer  

Which SQL statement is used to insert a new data in a database?

A.  INSERT INTO

B.  UPDATE

C.  ADD

D.  INSERT NEW

View Answer  

In a LIKE clause, you can could ask for any value ending in "qpt" by writing

A.  LIKE %qpt

B.  LIKE *ton

C.  LIKE ton$

D.  LIKE ^.*ton$

View Answer  

A NULL value is treated as a blank or 0.

A.  True

B.  Fasle

C.  None of the above

D.  

View Answer  

MySQL is

A.  A Programming language

B.  A Programming language

C.  A technique for writing reliable programs

D.  A Relational Database Management System

View Answer  

In a LIKE clause, you can ask for any 6 letter value by writing?

A.  LIKE ??????

B.  LIKE .{6} Answer 5: LIKE ^.{6}$

C.  LIKE ...... (that's six dots)

D.  LIKE ______ (that's six underscore characters)

View Answer