ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> Software >> Databases >> MySQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions (2040)
 SQL Server interview questions  SQL Server Interview Questions (1080)
 MS Access interview questions  MS Access Interview Questions (25)
 MySQL interview questions  MySQL Interview Questions (194)
 Postgre interview questions  Postgre Interview Questions (6)
 Sybase interview questions  Sybase Interview Questions (22)
 DB Architecture interview questions  DB Architecture Interview Questions (5)
 DB Administration interview questions  DB Administration Interview Questions (213)
 DB Development interview questions  DB Development Interview Questions (53)
 SQL PLSQL interview questions  SQL PLSQL Interview Questions (775)
 Databases AllOther interview questions  Databases AllOther Interview Questions (107)
Question
is it possible to assign two primary key in a table
 Question Submitted By :: MySQL
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
A table can have only one primary key assigned. 
Is This Answer Correct ?    14 Yes 0 No
Sushma S
 
Answer
# 2
IF WE MAKE COMPOSITE PRIMIRAY KEY THEN ONLY MORE THAN ONE
COLUMNS WILL BE BIND UP.
 
Is This Answer Correct ?    11 Yes 1 No
Sudipta Santra
 
 
 
Answer
# 3
At the end of the day a primary key is unique non null value
that the data is indexed upon.

Even if only one column can be explicitly defined as the PK.
It is possible to uniquely identify a row differently, by
creating a unique non null column that is indexed. It is
implicitly then a PK.
 
Is This Answer Correct ?    3 Yes 0 No
Jd
 
Answer
# 4
Answer is strictly NO...!!!

we may have morethan one unique column in a table but we should assign only one primary key...!!
 
Is This Answer Correct ?    3 Yes 0 No
Vignesh Lakshmirajan
 
Answer
# 5
no it doesn't possible 
Is This Answer Correct ?    3 Yes 0 No
Guest
 
Answer
# 6
any if one time primary key in a table 
Is This Answer Correct ?    0 Yes 0 No
Rajan
 
Answer
# 7
yes 
Is This Answer Correct ?    1 Yes 2 No
Rajan Bajalia
 

 
 
 
Other MySQL Interview Questions
 
  Question Asked @ Answers
 
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
what is the querry for all managers salary?   2
SELECT country,city FROM customers GROUP BY country ORDER BY city DESC HCL 5
If you specify the data type as DECIMAL (5,2), what?s the range of values that can go in this table?   2
What are the other commands to know the structure of table using MySQL commands except explain command? SigmaTree 2
what is the advantage of stored procedures, triggers and indexing in mysql   1
How we can copy one table data into another table whose name same as table but in differ database   8
What are CSV tables?   1
Give the syntax of GRANT commands?   3
how many ways we can get the current date in mysql?   2
A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.   1
in a master-master replication with two masters and alternate slaves running on two systems.can i have a script or any mysql command to know which one is right now acting as master.   1
 
For more MySQL Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com