Home » SQL & PL/SQL » SQL & PL/SQL » How to create an object table
How to create an object table [message #659536] Fri, 20 January 2017 09:49 Go to next message
janeya3110@gmail.com
Messages: 2
Registered: January 2017
Junior Member
Data to store:   

Cars
Car_Model  	Year	 	Driver
Swift		2015  		Ram
I20		2016  		Ram
Hcity		2002  		Arun
C300		2008  		Arun
Amaze		2004 		Raj

Drivers​ : 
Driver_Name  	Salary  	Cars
Ram		12000  		Swift, I20 
Arun		11000  		Hcity,C300
Raj		1000   		Amaze
   
There is only one table allowed to use for storing all the data:
  
CREATE TABLE objects    (       object    VARCHAR2 (100) NOT NULL ,      
				attribute VARCHAR2 (100) NOT NULL ,      
				value     VARCHAR2 (100)    );  
ALTER TABLE objects ADD CONSTRAINT attribute_PK PRIMARY KEY ( object, attribute );  


[mod-edit: code tags added by bb; next time please do so yourself]

[Updated on: Fri, 20 January 2017 13:09] by Moderator

Report message to a moderator

Re: How to create an object table [message #659537 is a reply to message #659536] Fri, 20 January 2017 10:19 Go to previous messageGo to next message
BlackSwan
Messages: 26207
Registered: January 2009
Location: SoCal
Senior Member

Welcome to this forum

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

Re: How to create an object table [message #659538 is a reply to message #659536] Fri, 20 January 2017 10:32 Go to previous messageGo to next message
Michel Cadot
Messages: 65849
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
There is only one table allowed to use for storing all the data:
Very bad idea, NEVER do that.
Read Normalization.

Re: How to create an object table [message #659543 is a reply to message #659536] Fri, 20 January 2017 10:50 Go to previous messageGo to next message
John Watson
Messages: 7622
Registered: January 2010
Location: Global Village
Senior Member
Is this a school homework assignment? If it is, say so and that will stop people from advising "don't do it that way".




Re: How to create an object table [message #659557 is a reply to message #659543] Sat, 21 January 2017 00:40 Go to previous messageGo to next message
janeya3110@gmail.com
Messages: 2
Registered: January 2017
Junior Member
This was asked in some test, And I just wanted to know how to do it as I am not having an understanding of object attribute table concept.

So to gain knowledge about the topic I asked this question here.

Thanks
Re: How to create an object table [message #659558 is a reply to message #659557] Sat, 21 January 2017 01:16 Go to previous message
Michel Cadot
Messages: 65849
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

As this is something that must not be done, in any case, there is no reason to know more about it, just forget about it and read the link I gave you which is what you have to know and must use.

Also this has nothing to do with what is called an object table.
http://docs.oracle.com/cd/E11882_01/server.112/e40540/glossary.htm#CNCPT89273
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_7002.htm
what you posted is an Entityattributevalue table.
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2314483800346542969
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:26200054737635

[Updated on: Sat, 21 January 2017 01:29]

Report message to a moderator

Previous Topic: Remove null records from collection
Next Topic: Effective Date/Min Eff Seq subquery issues
Goto Forum:
  


Current Time: Mon Oct 22 21:47:32 CDT 2018