Creating relations between tables in Oracle


create table CATEGORIES
(
  CATEGORYID number primary key,
  CATEGORYNAME varchar2(50),
  CATEGORYDESCRIPTION varchar2(50)
);


create table PRODUCTS
(
  PRODUCTID number primary key,
  PRODUCTNAME varchar2(50),
  PRODUCTDESCRIPTION varchar2(250),
  CATEGORYID number CONSTRAINT PRODUCTCATEGORYID
  REFERENCES CATEGORIES(CATEGORYID)
);



Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Getting Umbraco Content - IPublishedContent vs IContent vs Node vs Document