MySQL Interview Questions
Questions Answers Views Company eMail

Hi Team, This is kartik, I recently completed my B-tech. Importance of posting this question is for to know the best books on SQL(MYSQL/Oracle)? I like SQL concept's so much, at the same time i decided to choose SQL for my career purpose. So please suggest me the best books that are very helpful for a fresher to improve concepts like (SQL/PLSQL)Basics, programming concepts, architectures etc. Please consider my request as an important one. I am very thankful to you for providing this opportunity. If possible can you please send the names of books for my personal id also: karthikgdv1206@yahoo.com. Thanks, Kartik T

1055

how to find 2nd highest salary in random database salary of employer.....

4 4128

why we are join a tow table

1 1752




I have a table like this tblData (month int,Qty int) and i am inserting three rows in this table 1.tblData Values (1,100) 2.tblData Values (2,200) 3.tblData Values (3,300) The Result I want is the Running total of the field Qty that is 1 100 100 2 200 300 3 300 600 What is the Query for that ?

4 3467

mysql> select * from store; +------+-------+-------+ | id | month | sales | +------+-------+-------+ | 1 | 1 | 100 | | 1 | 2 | 100 | | 1 | 3 | 200 | | 1 | 4 | 300 | | 1 | 5 | NULL | | 1 | 6 | 200 | | 1 | 7 | 800 | | 1 | 8 | 100 | | 1 | 9 | 240 | | 1 | 10 | 140 | | 1 | 11 | 400 | | 1 | 12 | 300 | | 2 | 1 | 300 | | 2 | 2 | 300 | | 2 | 3 | 300 | | 2 | 4 | 200 | | 2 | 5 | 200 | | 2 | 6 | 200 | | 2 | 7 | 100 | | 2 | 8 | 100 | | 2 | 9 | 300 | | 2 | 10 | 100 | | 2 | 11 | 150 | | 2 | 12 | 150 | +------+-------+-------+ this is my table. i need to display output like this. +------+----------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | quarter4 | +------+----------+----------+----------+----------+ | 1 | 400 | 500 | 1140 | 840 | | 2 | 900 | 600 | 500 | 400 | +------+----------+----------+----------+----------+ what single query i have to write for this. i tried this query and it displays like the below mysql> select id,sum(sales) as quarter1,(select sum(sales) from store where mont h>3 and month<7 ) as quarter2,(select sum(sales) from store where month>6 and mo nth<10)as quarter3 from store where month>0 and month<4 group by id; +------+----------+----------+----------+ | id | quarter1 | quarter2 | quarter3 | +------+----------+----------+----------+ | 1 | 400 | 1100 | 1640 | | 2 | 900 | 1100 | 1640 | +------+----------+----------+----------+ 2 rows in set (0.00 sec) tel me how to rectify it.

2 2262

how to know the tables in database having foreign key?

2 2385

Difference between MYSQL_ASSOC,MYSQL_NUM and MYSQL_BOTH ?

TCS,

3 17508

using primary can we relate two table, with out foreign key?

1620




what is the size of date datatype in sql?

2 2846

What is the diff. bwt. primary key and unique key?

4 3024

What is the use of indexing table?

2 4093

what is the difference between MyIsam and InnoDb engine?

2 4405

how fastest access of data can be done from database ?

3 2653

what is the querry for all managers salary?

2 2185

how to find max salary from the database

3 3263


Post New MySQL Questions






Un-Answered Questions { MySQL }

all the queries used in sql

1509


suppose data is copie to oracle to sql by using DTS. Actully it taken 2 hours. suppose some day distribute the server in the middle of 2 hours. after how can i get the data ?

1054


In a property booking section want a query to check that property is booked from StartDate to EndDate.Booking Table field are given id proerty_id start_date checkout_date no_of_visitor booking date status Waiting yours answer.. Thanks In Advance...

1719


1)for snapshot replication which agents used? 2)for Transcation replication which agents used? 3)for merge replciation which agents used?

954


How to set the time zone for MySQL to particular country time?

2077






What are the critical issues you have resolved in your company

1093


I want to insert userid of a customer,order time,etc in a table called ordermaster with orderid as primary key.Same time the product codes and required quantities (a1,2 and a2 4 and so on)inserted in another table orderdetails with same orderid reference.How the code will be in JSP using MySQL?

871


How to define numeric 9(3) in db2 table without decimal point??

1795


What is difference between Sql server and MySql database? It may be silly question but i really dont know.

814


i made a table whih contain a column "Photo" with image data type and i want to insert the byte of a picture present in my hardisk using insert statement in that colum... so what will be my insert statement?

1493


Can u give the example by taking an unnormalized table and make that 1nf and then 25nf, and then 3 nf?

3576


1.how to fetch a value and Execute store procudure in mysql(INNODB) using phpMyAdmin? 2.can i wright a package in mysql database(INNODB)?

1136


Table - Products has number of products as below Productid ProductName 1 iPhone 2 iPad 3 BlackBerry Table - SalesPersonProduct has the below records Salespersonid productid S1 1 S1 2 S1 3 S2 1 S3 2 Write a SQL query that returns the total number of sold products

1680


What is striped backup

1216


How internally data stores in MyISAM and INNODB table types?

1435