sql-info.de

6. Miscellaneous

6.1. External Links

(No links at present)


Comments
Another important gotcha (or maybe it ain't a gotcha but something common) is something I've recently came across. When performing a search through a fulltext index against a phrase, only words equal longer than 4 symbols will be searched. This way if you search for "dye" in a table containing fields with values "red dye" and "green dye", you won't get the expected results.

I'm not very experienced in MySQL, it looked repelling to me from the first time I had a chance to work with it. It's off the standards, unpredictable, somewhat bloated.
Posted by: Alexander | 2009-11-11 10:57
I am currently taking a MYSQL class. My instructor says the following code should work. Please help me figure this out :)

CREATE TABLE grades
( stu_id INT(9),
grd_grade CHAR(1),
inst_id INT(4),
crs_id CHAR(7),
Constraint PK_grades PRIMARY KEY(stu_id, crs_id),
Constraint FK_Grades_Course FOREIGN KEY (crs_id) References Course(crs_id),
Constraint FK_Grades_Student Foreign Key (stu_id) References Student (stu_id),
Constraint FK_Grades_Instructor Foreign Key (inst_id) References Instructor (inst_id),
CONSTRAINT ck_gradeA CHECK (grd_grade = 'A'),
CONSTRAINT ck_gradeB CHECK (grd_grade = 'B'),
CONSTRAINT ck_gradeC CHECK (grd_grade = 'C'),
CONSTRAINT ck_gradeD CHECK (grd_grade = 'D'),
CONSTRAINT ck_gradeF CHECK (grd_grade = 'F')
);

Thank You!
Posted by: Vee | 2011-10-18 21:02