Jump to content

VLA

Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

VLA's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. mmm wel you would be right if the it was a user profile but in this case profile is a set of rules... and is not related to a user there for i have another question . i want to get all rules with a certain profile id. but i want them order by rule.cat so something like: SELECT rules.rule_id,rules.description,rules.cat,profile_settings.setting FROM rules,profile_settings WHERE rules.rule.id=profile_settings.rule_id AND profile_settings.profile_id=0 i filled table rules ,profile ,profile_setting, acces. so rule_id=o exists as wel is profile_id=0 and profile_setttings.setting What am i doing wrong then. please advise . Thanks in Advance
  2. Thanks again! ok lets say i choose to normalize my database a bit\' should this be oke ? SQL structure: CREATE TABLE rules( Rule_id INT NOT NULL AUTO_INCREMENT, Code TEXT NOT NULL, cat TINYTEXT, sub_cat TINYTEXT, description TEXT, PRIMARY KEY (Rule_id), UNIQUE UC_Rule_id (Rule_id)); CREATE TABLE Acces( User VARCHAR(8) NOT NULL, Password VARCHAR(5) NOT NULL, PRIMARY KEY (User)); CREATE TABLE profile( profile_id INT NOT NULL AUTO_INCREMENT, profile_name TEXT, description TEXT, author VARCHAR(8) NOT NULL, User VARCHAR(8), FOREIGN KEY (User) REFERENCES Acces (User), PRIMARY KEY (profile_id), UNIQUE UC_profile_id (profile_id)); CREATE TABLE Profile_settings( setting TINYINT DEFAULT 0, profile_id INT NOT NULL, Rule_id INT, FOREIGN KEY (profile_id) REFERENCES profile (profile_id), FOREIGN KEY (Rule_id) REFERENCES rules (Rule_id)); diagram ??
  3. First of all thank you for replying maybe it is a bad example . it is like this .... i have a table with rules/checks with rule_ID Rule_code etc. then a table Profiles (profile_ID,Profile name) now a rule can be set to 0(default) 1 warning 2error. now i want to save these settings as a profile should i add a third table with rulesettings_for_profile with profile_id form the the table profile_ID+rule_ID as primary key and one more field like value (the 0,1,2) Thanks Danny
  4. Hello Guy\'s , Can you help me out here . What would be de best way to do this? Lets say i have a table questions and a table persons . i want to have every person answer all the questions with a y or n or 0,1. can i better make a new table person-answers ? when i do so how to do i make sure that if i make a new person in table persons that this person no also exist in person-answers and has all his answers are 0 by default. the same would be if i creat a new question i want it autmaticly created in the person-answer for every person with a default value 0. what would be the best way to do this. Thanks in advance, Danny
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.