Here are three tables, based on these tables, write a MySQL query for below ques
ID: 3840974 • Letter: H
Question
Here are three tables, based on these tables, write a MySQL query for below question:
Due to a bug in the application, some data are now dirty and need to be cleaned. Find the
user id, article id, and title of articles that have quality value of 'Clean' but that deserve a lesser quality
value.
(We know that detectors will have the power to report article(s) as being
fake. When a detector reports an article as being fake, the detector also needs to offer a
reason. The datetime when a user is designated as a detector will also be recorded. AND
indicator – quality – will be also maintained for each article. The possible value of quality is {Junk, Suspicious, Clean}. When an article is first posted, “Clean” will be assigned. If the report count for the article from detectors becomes
greater than 5, “Suspicious” will be its new quality score. If 10 or more detectors have
reported an article, “Junk” will be the score assigned to that article.)
CREATE TABLE Users (
);
);
);
Here are three tables, based on these tables, write a MySQL query for below question:
Due to a bug in the application, some data are now dirty and need to be cleaned. Find the
user id, article id, and title of articles that have quality value of 'Clean' but that deserve a lesser quality
value.
(We know that detectors will have the power to report article(s) as being
fake. When a detector reports an article as being fake, the detector also needs to offer a
reason. The datetime when a user is designated as a detector will also be recorded. AND
indicator – quality – will be also maintained for each article. The possible value of quality is {Junk, Suspicious, Clean}. When an article is first posted, “Clean” will be assigned. If the report count for the article from detectors becomes
greater than 5, “Suspicious” will be its new quality score. If 10 or more detectors have
reported an article, “Junk” will be the score assigned to that article.)
CREATE TABLE Users (
userid INTEGER NOT NULL, account VARCHAR(30) NOT NULL, password VARCHAR(60) NOT NULL, email VARCHAR(60) NOT NULL, jobtitle VARCHAR(60) NOT NULL, name_first VARCHAR(60) NOT NULL, name_middle VARCHAR(60), name_last VARCHAR(60) NOT NULL, user_since DATETIME NOT NULL, PRIMARY KEY (userid) CREATE TABLE Article ( userid INTEGER NOT NULL, articleid INTEGER NOT NULL, posting_datetime DATETIME NOT NULL, popularity VARCHAR(20) NOT NULL, quality VARCHAR(20) NOT NULL, title VARCHAR(100) NOT NULL, content VARCHAR(1000) NOT NULL, PRIMARY KEY (userid, articleid), FOREIGN KEY (userid) REFERENCES Poster (userid) ON DELETE CASCADE);
CREATE TABLE Detector ( userid INTEGER NOT NULL, detector_since DATETIME NOT NULL, PRIMARY KEY (userid), FOREIGN KEY (userid) REFERENCES Users (userid) ON DELETE CASCADE);
);
Explanation / Answer
This will retrieve the userid,article and its title which is having the quality value as Clean.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.