MySQL Forums
Forum List  »  InnoDB

my script
Posted by: dan bilauca
Date: May 09, 2006 06:01PM

CREATE TABLE ziar (
ziarID INTEGER UNSIGNED NOT NULL,
nr_ziar VARCHAR(255) NOT NULL UNIQUE,
an_ziar INTEGER UNSIGNED,
data_inceput DATE UNIQUE,
data_sfarsit DATE UNIQUE,
PRIMARY KEY (ziarID)
)type=InnoDB;

CREATE TABLE categorii (
categorieID INTEGER UNSIGNED NOT NULL,
categorie VARCHAR(255),
PRIMARY KEY (categorieID)
)type=InnoDB;

CREATE TABLE reporteri(
reporterID INTEGER UNSIGNED NOT NULL,
nume VARCHAR(255),
prenume VARCHAR(255),
pseudonume VARCHAR(255),
mail VARCHAR(255),
PRIMARY KEY (reporterID)
);

CREATE TABLE useri(
userID INTEGER UNSIGNED NOT NULL,
nume VARCHAR(255),
localitatea VARCHAR(255),
PRIMARY KEY (userID)
)type=InnoDB;

CREATE TABLE poze(
pozaID INTEGER UNSIGNED NOT NULL,
nume VARCHAR(255),
descriere VARCHAR(255),
PRIMARY KEY (pozaID)
)type=InnoDB;

CREATE TABLE articole(
articolID INTEGER UNSIGNED NOT NULL, INDEX articolID_ind (articolID),
titlu TEXT,
subtitlu TEXT,
articol TEXT,
ziarID INTEGER UNSIGNED NOT NULL, INDEX ziarID_ind (ziarID),
categorieID INTEGER UNSIGNED NOT NULL, INDEX categorieID_ind (categorieID),
reporterID INTEGER UNSIGNED NOT NULL, INDEX reporterID_ind (reporterID),
pozaID INTEGER UNSIGNED NOT NULL, INDEX pozaID_ind (pozaID),
PRIMARY KEY(articolID),
FOREIGN KEY(ziarID) REFERENCES ziar(ziarID) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(categorieID) REFERENCES categorii(categorieID) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(reporterID) REFERENCES reporteri(reporterID) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(pozaID) REFERENCES poze(pozaID) ON DELETE CASCADE ON UPDATE CASCADE
)type=InnoDB;

CREATE TABLE comentarii(
comentID INTEGER UNSIGNED NOT NULL,
userID INTEGER UNSIGNED NOT NULL,
articolID INTEGER UNSIGNED NOT NULL,
comentariu TEXT,
PRIMARY KEY (comentID),
FOREIGN KEY (articolID) REFERENCES articole(articolID) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (userID) REFERENCES useri(userID) ON DELETE CASCADE ON UPDATE CASCADE
)type=InnoDB;


would u pls take a sit and help me finding the bug in this scrip coz i spent 2 days and 2 nights for it and nothing happens. I test the example of EDWIN DANGO and it works fine, 100%. WHAT IS WRONG WITH MY SCRIP ?



Edited 1 time(s). Last edit at 05/10/2006 12:38AM by dan bilauca.

Options: ReplyQuote


Subject
Views
Written By
Posted
647734
March 24, 2005 01:20PM
5316
October 09, 2012 09:48PM
3595
December 19, 2011 10:13PM
my script
9030
May 09, 2006 06:01PM
8214
November 15, 2006 02:05PM
7261
T D
February 01, 2008 06:47AM
9073
August 27, 2008 08:08AM
9579
December 03, 2008 10:15AM
6037
May 01, 2009 07:39AM
3300
August 29, 2011 04:46PM
4876
s l
December 15, 2009 01:48PM
4811
December 22, 2009 02:54AM
3134
February 18, 2011 08:55AM
3721
May 24, 2011 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.