question

tcalbert93 avatar image
tcalbert93 asked

Managers assigned to Vendors

[link text][1] [1]: /storage/temp/3062-sid-3-logical-model.docx So I was given this question:Please provide your SQL statement and the result set that is a list of relationship managers who are assigned to a vendor. Note that the list should be sorted alphabetically by last name in ascending order. My answer was: SELECT r.rm_id "Manager ID", r.rm_lname AS "Manager Last Name", v.v_num "Vendor ID", v.v_name "Vendor Name" from talbert3_relationship_manager r, talbert3_vendor v WHERE r.rm_id=v.rm_id ORDER BY "Manager Last Name"asc; I was then given this question:Please provide your SQL statement and the result set that is a list of relationship managers (ID and full name) who are not assigned to a vendor account. Note that the list should be sorted alphabetically by last name in descending order. My answer is: SELECT r.rm_fname "Manager FName", r. rm_lname AS "Manager LName", r.rm_id "Manager ID", v.v_num "Vendor ID" from talbert3_relationship_manager r, talbert3_vendor v WHERE r.rm_id<>v.rm_id ORDER BY "Manager LName" desc; I know my data so I know that the second part is incorrect, but i'm not really sure how to fix it. Thanks!
oraclehomework
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
1 Like 1 ·

1 Answer

·
morlin avatar image
morlin answered
,I suggest trying: SELECT r.rm_fname "Manager FName", r.rm_lname AS "Manager LName", r.rm_id "Manager ID", v.v_num "Vendor ID" from talbert3_relationship_manager r LEFT join talbert3_vendor v on r.rm_id=v.rm_id WHERE v.rm_id IS NULL ORDER BY "Manager LName" desc;
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.