GeekInterview.com
Series: Subject: Topic:

MYSQL Interview Questions

Showing Questions 1 - 20 of 58 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

How to display nth highest record in a table for example? How to display 4th highest (salary) record from customer table?

Asked By: Naveen k Sharma | Asked On: Apr 4th, 2006

Answered by: Nadeem on: Apr 2nd, 2013

SELECT emp_salary FROM salary_detail ORDER BY emp_salary desc LIMIT 3,1

Answered by: sgarach on: Dec 28th, 2012

SELECT salary FROM customer
ORDER BY salary DESC
LIMIT 3,1

Write a c/c++ program to add a user to MySQL.

Asked By: purushottam77 | Asked On: Feb 19th, 2012

The user should be permitted to only "select" entries from the given database. what resources did you use to do research for this project? what development tools did you do use to complete the project? how did you test & debug the project? why have you chosen to use the programming language used in...

Answered by: sumanth.boss on: May 26th, 2012

Dude, i tried to execute it . it execute successfully . but the grantACC is not getting executed . after adding user and trying to login him , it is saying error 1045(28000)

Answered by: vishnu raju on: Mar 13th, 2012

try this :)"cpp #include #include #include #include int main() { char name[10]; char password[10]; char database[10]; char addUser[60]=""; char grantACC[60]=""; // initiali...

How is structure of a table got in MySQL?

Asked By: RajivPrasad | Asked On: Mar 25th, 2007

Answered by: trimurthy on: May 18th, 2012

you can also see the structure by using this statement "show create table table_name";

Answered by: rockxy1214 on: Feb 20th, 2008

ya that's rightdesc table is easy to useThink this way to desc a table,DB has to save the info some where right? its the information _schema DB where all the info related to Database or table...

MySQL operator

Asked By: tallman07 | Asked On: Sep 13th, 2010

Which of the following is not a MySQL operator?A. Between..And..,b. Like,c. In,d. Is null

Answered by: venkatesh on: May 13th, 2012

LIKE is an operator

Answered by: Dattatray kolpe on: Feb 4th, 2012

d. Is NULL

How is stored procedures managed in MySQL?

Asked By: Robert | Asked On: Mar 25th, 2007

Answered by: Lokesh M on: Nov 30th, 2011

Details of existing stored procedures in MySQL can be obtained from ROUTINES table in INFORMATION_SCHEMA database.

Stored Procedures can be managed using the following:

CREATE [FUNCTION|PROCEDURE]
ALTER [FUNCTION|PROCEDURE]
DROP [FUNCTION|PROCEDURE]
SHOW CREATE [FUNCTION|PROCEDURE]

What are the link types for joins, =? What datasets result?

Asked By: SoS | Asked On: Oct 19th, 2011

What are the link types for joins, =? What datasets result? I cannot find anything about these link types online or in help.

PL/SQL views and cursors

Asked By: bhavna123 | Asked On: Oct 30th, 2010

What is better to use, views or cursors? Why?

Answered by: Sumy on: Oct 3rd, 2011

Views are best to use.

The Reason behind this is mainly the performance. Views just have select statements and retrieves the information faster. Cursors take time to retrieve the info row by row.

Thanks In advance!

What is the differance between exec and execute in stored procedure?

Asked By: hythamraju | Asked On: Aug 31st, 2011

Answered by: Satish on: Sep 9th, 2011

They are the same, its like execute alias name is exec.there is a difference between EXEC() and EXEC , EXEC()function takes dynamic string as input and executes them and it needs more bytes compared.

How do you use outer join in MySQL

Asked By: lekhrajdeshmukh | Asked On: Feb 6th, 2008

Answered by: LUCKY on: Aug 28th, 2011

SELECT TABLE1.COLOMN ,TABLE1.COLUMN......, TABLE2.COLOMN, TABLE2.COLUMN FROM TABLE1 OUTTER JOIN ON TABLE1.COMMON COLUMN= TABLE2.COMMON COLUMN

Answered by: helter on: Jul 22nd, 2011

Full outer join combines the effect of applying both left and right outer joins. A records in the full outer joined tables do not match, the result set will have NULL values for every column of the ta...

How to view all triggers in MySQL?

Asked By: Bessie | Asked On: Mar 25th, 2007

Answered by: Anant on: Aug 9th, 2011

type

Show Triggers;

Answered by: sampra on: Feb 12th, 2008

show triggers;     

What are the data types available in MySQL?

Asked By: sripri | Asked On: Mar 25th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,

MySQL supports following data types:


Hi,

Numerical type
String type
Date and time type

If you need further clarification or discussion please mail me at altafhsayyed@yahoo.com

Thanks and regards

Answered by: sampra on: Mar 10th, 2008

int varchar char date double long etc are available for mysql

What is reload privileges in MySQL used for?

Asked By: nancyphilips | Asked On: Mar 25th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,When you update or add privileges in MySQL grant tables(db,users,tables,columns,hosts etc) are updated. These changes takes effect when mysql server restarts. MySQL server reads all grant tables at...

Answered by: adilraufkhan on: Feb 17th, 2009

Reload privileges are used to apply any changes on settings related to privileges without re starting Mysql's current session

syntax to use:

mysql -u username -p password -e "flush privileges";

What is the command for counting all the rows in a table in MySQL?

Asked By: StephenRaj | Asked On: Mar 25th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,

Select count(COLUMN_NAME) from information_schema.columns where table_name='table_name';

In above query please put your table name in place of 'table_name'


If you need any further assistance or discussion please mail me at altafhsayyed@yahoo.com

Thanks and regards

Answered by: sampra on: Feb 14th, 2008

select count(*) from table_name

What are the platforms supported by MySQL?

Asked By: Remasri | Asked On: Mar 25th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,MySQL is written in C,C++.MySQL supports following platforms.Please check URL.http://dev.mysql.com/doc/refman/5.0/en/supported-os.htmlThere are 2 methods for installing mysql:1. Installing compiled...

Answered by: Veer_Bahadur on: Feb 1st, 2008

It supports all platforms but depending upon the platforms it have different different setup files and libraries.

Is it possible to delete duplicate records from a table with out using rowid in MySQL?

Asked By: Joe | Asked On: Apr 18th, 2007

Can use rownum.If possible explain.Regards,joe

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Yes it is possible.Please check following syntax:delete from table1 USING table1, table1 as vtable WHERE (NOT table1.ID=vtable.ID) AND (table1.field_name=vtable.field_name)In above place column name i...

Answered by: duttasujata on: Oct 21st, 2010

Delete T1 from tablename as T1, tablename as T2 where T1.name=T2.name and T1.id>T2.id

How many types of join are supported by MySQL? Which are they? Explain

Asked By: nikunj | Asked On: May 18th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Straight Join is similar to inner join. But a small difference.It checks left table first to optimize query.

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

MySQL Supports following joins

Inner
Cross
Strainght
Outer
Natural

Please check following Link:
http://dev.mysql.com/doc/refman/5.0/en/join.html

How a database is copied from one machine to another?Explain with an example.

Asked By: amarmail_999 | Asked On: Sep 15th, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hello everybody,We can copy database through following meansBackup( Physical or logical)ReplicationIn physical backup database files are copied and pasted to target location.We can use any file backup...

Answered by: Armstrong Bala on: May 23rd, 2011

export the database in .sql format from 1 system and import that .sql file to another system using phpmyadmin tool.

How to display nth highest record in a table for example ?

Asked By: Vishwapati Mishra | Asked On: Nov 2nd, 2007

Select salary from tablename order by desc limt 4;

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Suppose we have to find records in the emp_salary table with nth highest value for salary.

select * from emp_salary whare salary in(select distinct salary from emp_salary order by salary desc limit n-1,1);

Answered by: Siva Krishna Yarlagadda on: Apr 3rd, 2011

select salary form employee order by salary desc limit 1,1

3rd Highest Salary-->Change Limit 2,1
4th highest salary-->change Limit 3,1

What is the Oracle rowid counterpart in MySQL?

Asked By: anil.ajax | Asked On: Nov 23rd, 2007

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,


There is no rowid counterpart in MySQL. But if you want same feature in MySQL then you need to add following column in each table you need rowid.

id bigint unsigned not null autoincrement

If you need any further assistance or discussion please mail me at altafhsayyed@yahoo.com

Thanks and regards

Answered by: gakorde on: Oct 5th, 2010

There is no concept like rowid in MySQL

Using table index

Asked By: nagaphp_indore | Asked On: Apr 10th, 2009

Is it required to use index when the MySQL table has only 100 rows? Justify your answer

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Hi,Index is used to speed up query.If particular column is used often in queries and table has lot of data.Then it is recommended to create index for that column of the table. It will speed up the que...

Answered by: Altaf Hussain Sayyed on: Jun 29th, 2011

Index is a database structure which stores column value in order and pointer to the row containing this value.During query execution index is used to fast search column data used in where condition. I...

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.