ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories >> Software >> Databases >> MySQL
 
 


 

Back to Questions Page
 
Question
SELECT country,city
FROM customers 
GROUP BY country
ORDER BY city DESC

Rank Answer Posted By  
 Question Submitted By :: Nitin
This Interview Question Asked @   HCL
I also faced this Question!!   © ALL Interview .com
Answer
is right or not
 
0
Nitin
 
 
Answer
this is right coz here order by clause is at the end of 
query...
 
0
Prajakta
 
 
Answer
This is wrong because there is no aggregate function in the 
query when a group by clause is used.

The above query could be like:

1. SELECT country, count(city)
2. FROM customers 
3. GROUP BY country
4. ORDER BY country DESC

* Correction at line 1 & 4.
 
0
Manoj Pandey
 
 
 
Question
Fname    Lname    City      Pin
ramesh   kumar    salem     365241

Query to generate a code having the firstletter of
Fname,Lname & 3letter of city Last 3letter of pin,all in
capital letters
Rank Answer Posted By  
 Question Submitted By :: Ramesh
I also faced this Question!!   © ALL Interview .com
Answer
select ucase(mid(Fname,1,1)) as
FirstName,ucase(mid(Lname,1,1)) as
LastName,ucase(mid(City,3,1)) as Cty,ucase(mid(Pin,-3))as
PinCode from tablename 
 
0
Mdeva
 
 
Question
Query to select passwords from a table having a column
"Password" Whose length is b/w 8 &15 and having   'A' as the
first character in the password irrespective of case.
Rank Answer Posted By  
 Question Submitted By :: Ramesh
I also faced this Question!!   © ALL Interview .com
Answer
SELECT Password
FROM tablename
WHERE Password LIKE 'A%'
AND Length( Password) >=8
AND Length( Password) <=15
 
0
Mdeva
 
 
Question
What is the maximum length of a table name, a database name,
or a field name in MySQL?
Rank Answer Posted By  
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!   © ALL Interview .com
Answer
Database name: 64 characters Table name: 64 characters
Column name: 64 characters
 
0
Rajan Vardawaj
 
 
Question
How many ways we can we find the current date using MySQL?
Rank Answer Posted By  
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!   © ALL Interview .com
Answer
SELECT CURDATE(); SELECT CURRENT_DATE(); SELECT CURTIME();
SELECT CURRENT_TIME();
 
0
Rajan Vardawaj
 
 
Question
Give the syntax of GRANT commands?
Rank Answer Posted By  
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!   © ALL Interview .com
Answer
The generic syntax for GRANT is as following GRANT [rights]
on [database] TO [username@hostname] IDENTIFIED BY
[password] Now rights can be: a) ALL privilages b)
Combination of CREATE, DROP, SELECT, INSERT, UPDATE and
DELETE etc. We can grant rights on all databse by usingh *.*
or some specific database by database.* or a specific table
by database.table_name.
 
0
Rajan Vardawaj
 
 
Question
Give the syntax of REVOKE commands?
Rank Answer Posted By  
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!   © ALL Interview .com
Answer
The generic syntax for revoke is as following REVOKE
[rights] on [database] FROM [username@hostname] Now rights
can be: a) ALL privilages b) Combination of CREATE, DROP,
SELECT, INSERT, UPDATE and DELETE etc. We can grant rights
on all databse by usingh *.* or some specific database by
database.* or a specific table by database.table_name.
 
0
Rajan Vardawaj
 
 
Question
What is the difference between CHAR and VARCHAR data types?
Rank Answer Posted By  
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!   © ALL Interview .com
Answer
CHAR is a fixed length data type. CHAR(n) will take n
characters of storage even if you enter less than n
characters to that column. For example, “Hello!” 

will be stored as “Hello! ” in CHAR(10) column. VARCHAR is a
variable length data type. VARCHAR(n) will take only the
required storage for the actual number 

of [...]
 
0
Rajan Vardawaj
 
 
Question
how many ways we can get the current date in mysql?
Rank Answer Posted By  
 Question Submitted By :: Ranjitbd
I also faced this Question!!   © ALL Interview .com
Answer
current_Date->return the current date
 
0
Nathiya
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com