Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We are working on Subqueries vs Joins. Please assist with a,b,c,and d. After I c

ID: 3857335 • Letter: W

Question

We are working on Subqueries vs Joins. Please assist with a,b,c,and d. After I create the table Secretary. Thank you.

a. Create a query that lists the names of departments that have secretaries (use IN and the Secretary table in a subquery with the Department_to_major table in the outer query). Save this query as q77a.

b.. Create a query that lists the names of departments that do not have secretaries (use NOT.. IN). Save this query as q77b.

c. Add one more row to the Secretary table that contains (This could be a situation in which we have hired Brenda but have not yet assigned her to a department.)

d. Recall q77a and re-run it.

e. Recall q77b and re-run it.

Secretary dCode ACCT cosc ENGL name Sally Chris Maria 8

Explanation / Answer

step1 :CREATE TABLE Secretary (dcode Char(4),name varchar(20));

a) SELECT dcode FROM Secretary WHERE dcode IN (SELECT dcode FROM Secretary);

b) SELECT dcode FROM Secretary WHERE dcode NOT IN (Select dcode From Secretary Where (name != ''))

c) INSERT INTO Secretary (dcode, name) VALUES ('', 'Brenda ');

d) SELECT dcode FROM Secretary WHERE dcode IN (SELECT dcode FROM Secretary);

e) SELECT dcode FROM Secretary WHERE dcode NOT IN (Select dcode From Secretary Where (name != ''))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote