Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, G NIRANJAN.

Asked: July 27, 2016 - 6:49 am UTC

Last updated: July 28, 2016 - 12:58 pm UTC

Version: 11g

Viewed 1000+ times

You Asked

Hi Sir i am new for oracle.
____Q1) 2. Disabled validate - 3. Enabled novalidate 4. Enabled validate

Please explain briefly with primary key constraints only with example (either 3Q or 4Q take any one )
Q2)while doing outer join(left/reght) non matched records come with null,i want replace with any value or char...can i do or not ? i do how and give me syntax.
Q3) Can we create public and private synonym with same name for a table with in same schema...
public and private synonym both are stored in all_synonym.is it right ?
Q4)The purpose of rank and dense rank ?
(i known rank display like 1 2 2 4 ....
dense rank 1 2 2 3...)

and Chris said...

1. The docs explain this well:

http://docs.oracle.com/database/121/CNCPT/datainte.htm#CNCPT33339

2. You can use nvl or coalesce

3. Yes, you can create public synonyms and private synonyms on the same table:

SQL> create user u identified by u;

User created.

SQL> create table t (
  2    x int
  3  );

Table created.

SQL>
SQL> create public synonym t for chris.t;

Synonym created.

SQL> create synonym u.t for chris.t;

Synonym created.

Public synonyms aren't "in the same schema" though. They're public - visible to everyone. Avoid these as much as possible and stick with private synonyms.

You can view details of all the synonyms you have access to in all_synonym, yes.

4. To provide a ranked number for your rows! Rank gives the "Olympic rank". If there's a tie for 1st, then there's no second/silver medal. The next is third. So there can be gaps in your numbering. Dense_rank leaves no gaps in the numbers.

https://www.youtube.com/watch?v=Tuxxbuywb1w

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

G NIRANJAN REDDY, July 28, 2016 - 1:52 pm UTC


More to Explore

Analytics

Analytic SQL got you confused? Check out Connor McDonald's complete video course.