What is the difference between UNIQUE and DISTINCT keywords in DBMS?



What is the difference between UNIQUE and DISTINCT keywords in DBMS?..

Answer / anjaligarg

First we declare is as primary key and after group by we can get uniqu values.

CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
PRIMARY KEY (ID)
);

SELECT ID, LastName,FirstName
FROM Persons
GROUP BY ID, LastName,FirstName;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What do you mean by subquery?

0 Answers  


Can two tables have the same primary key?

0 Answers  


List out some of the requirements to set up a sql server failover cluster?

0 Answers  


What are the differences between left join and inner join in sql server?

0 Answers  


What is bcnf normalization form?

0 Answers  






Is sql server difficult to learn?

0 Answers  


What stored by the tempdb ? : sql server database administration

0 Answers  


what is the primary use of the model database? : Sql server administration

0 Answers  


Explain what is it unwise to create wide clustered index keys?

0 Answers  


What is an Index?

3 Answers   Yardi Software,


1.What is the deferece between DBMS & RDBMS? 2.How can you trouble shoot? If u will get error while installing sql server? 3.How can u trouble shoot slow running query? 4.how can u trouble log shipping errors? 5.why do we use merge replication instead of T.log replication?

7 Answers   Microsoft,


How to write the storeprocedure with in the store procedure? and how can we write the store procedure with in a trigger vice versa? plz post me the exact answer?

0 Answers   ABC,


Categories