Skip to content

Tag: mysql-workbench

SQL query optimization for speed

So I was working on the problem of optimizing the following query I have already optimized this to the fullest from my side can this be further optimized? Answer Your query although joined ok, is an overall bloat. You are using the dim_ad_type table on the outside, just to make sure it exists on the inside as…

MySQL Foreign Key ERROR. Constraint key error

I can’t add a foreign key to an existing table. The error is as follows Answer I’ve written the schema below which is working. I advise against using the same name student_id for the constraint as already used for the column. I would prefer fk_student_id to avoid risk of an ambiguity or conflict a…

how to single out certain names in sql

So I have this problem in SQL where the question is this: List the sId and name of students that applied to “WSU” But not “U of O”. and my attempt was this: However this does not do the trick as it doesn’t catch that some of the students had already applied to U of O. MRE: And then of