Home » Other » General » Basic question (SQL)
Basic question [message #671805] Thu, 20 September 2018 05:02 Go to next message
lucasmol
Messages: 4
Registered: September 2018
Junior Member
Hi, I am new in SQL and I have this exercise that I don't know do it.

According to the attached list (which I do not have but is worth any example) indicate the physical model of the tables and the relationships of a relational database to obtain this list.

Thank a lot!!
Re: Basic question [message #671808 is a reply to message #671805] Thu, 20 September 2018 05:23 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
Welcome to the forum.

You haven't attached anything and it's not obvious what you are asking.
Re: Basic question [message #671811 is a reply to message #671808] Thu, 20 September 2018 05:27 Go to previous messageGo to next message
lucasmol
Messages: 4
Registered: September 2018
Junior Member
Yes, I dont have the table but some table is ok. The question is according to a list of a table how is the physical model of the tables and relationships obtained?
Re: Basic question [message #671812 is a reply to message #671811] Thu, 20 September 2018 05:30 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
It's literally impossible to ascertain the physical layout of the tables from a list of table names and nothing more.


Edit: Or are you asking how you take a list and query the data dictionary for the information?

[Updated on: Thu, 20 September 2018 05:31]

Report message to a moderator

Re: Basic question [message #671813 is a reply to message #671812] Thu, 20 September 2018 05:32 Go to previous messageGo to next message
lucasmol
Messages: 4
Registered: September 2018
Junior Member
Hi Roachcoach, yes that is exactly the question
Re: Basic question [message #671814 is a reply to message #671813] Thu, 20 September 2018 05:37 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
You need to query the data dictionary. The best way to do this (in my experience) is to have a poke around the dictionary:

select * from dict order by 1
--for likely related views
select * from dict where table_name like 'DBA%TAB%' order by 1

This will return table/view names for you to query subsequently. Have a look at the comments and cross reference that with the documentation online.


Beyond that the requirement is a bit too broad ranging for a simple answer.

Edit: Oh and read the CONCEPTS book. It'll help more than anything

[Updated on: Thu, 20 September 2018 05:39]

Report message to a moderator

Re: Basic question [message #671815 is a reply to message #671813] Thu, 20 September 2018 05:45 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
As Roachcoach points out. You need to do some reading. Try Database Concepts.
Re: Basic question [message #671816 is a reply to message #671815] Thu, 20 September 2018 05:50 Go to previous messageGo to next message
lucasmol
Messages: 4
Registered: September 2018
Junior Member
If I know, I'm very newbie to this. Thank you very much!!!
Re: Basic question [message #671830 is a reply to message #671814] Thu, 20 September 2018 07:56 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Hi Roachcoach,


I cannot see the view names after querying on dict. Please can you confirm once?

[Updated on: Thu, 20 September 2018 07:57]

Report message to a moderator

Re: Basic question [message #671831 is a reply to message #671830] Thu, 20 September 2018 08:02 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
Show us what you're doing. Copy and paste your SQL*Plus session into this thread.
Re: Basic question [message #671832 is a reply to message #671830] Thu, 20 September 2018 08:05 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
msol25 wrote on Thu, 20 September 2018 05:56
Hi Roachcoach,


I cannot see the view names after querying on dict. Please can you confirm once?
Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

We don't know what you have.
We don't know what you do.
We don't know what you see.

I can confirm that you posted NO actionable detail above.
What would your coworkers say if you said to them "I cannot see the view names after querying on dict. Please can you confirm once?"?
Re: Basic question [message #671833 is a reply to message #671831] Thu, 20 September 2018 08:06 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Hi Roachcoach/Blackswan,

Sorry to bear me. It gives data dictionary views and table details.

[Updated on: Thu, 20 September 2018 08:12]

Report message to a moderator

Re: Basic question [message #671834 is a reply to message #671833] Thu, 20 September 2018 08:11 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'd ignore dict and just query all_views to see all the views you have access to.
Re: Basic question [message #671835 is a reply to message #671833] Thu, 20 September 2018 08:14 Go to previous messageGo to next message
gazzag
Messages: 1118
Registered: November 2010
Location: Bedwas, UK
Senior Member
TEST_VW is a user-created view. It won't be dict. Try:
SQL> select * from dict where table_name like '%TAB%'
Re: Basic question [message #671836 is a reply to message #671835] Thu, 20 September 2018 08:15 Go to previous messageGo to next message
msol25
Messages: 396
Registered: June 2011
Senior Member
Thanks Gazzag.
Re: Basic question [message #671837 is a reply to message #671833] Thu, 20 September 2018 09:02 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
msol25 wrote on Thu, 20 September 2018 09:06
Hi Roachcoach/Blackswan,

Sorry to bear me. It gives data dictionary views and table details.

I don't quite understand.

You've been here over 7 years, are a senior member and you don't know the basics?
Previous Topic: Upgrade from 9i single instance to 11g RAC
Next Topic: Stored Procedure Question. HELP
Goto Forum:
  


Current Time: Thu Mar 28 17:34:47 CDT 2024