| 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  |
| Nitin |
| |
| |
| Answer | this is right coz here order by clause is at the end of
query...  |
| 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.  |
| 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  |
| 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  |
| 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  |
| 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();  |
| 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.  |
| 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.  |
| 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 [...]  |
| 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  |
| Nathiya |
| |
| |
|
| |
|
Back to Questions Page |