Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2013
    Posts
    41

    Unanswered: I'm working on the following query, please help

    Please consider the following tables:

    Code:
    Table Name: Person
    
    Person_Id   Name
    
    
    Table Name: DVD
    
    DVD_ID  Owner_ID  Title
    Here is the query:
    Write a query that returns the list of DVDs that belong to owners who own “Superman”

    Here is my solution:

    Code:
    SELECT p.name,d.dvd_id
    FROM  DVD d,Person p
    WHERE p.person_id = d.dvd_id
    AND Title = 'Superman' ;
    Please let me know if the above query is correct or not.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Please let me know if the above query is correct or not.
    not correct
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2013
    Posts
    41
    What happened?
    Quote Originally Posted by anacedent View Post
    >Please let me know if the above query is correct or not.
    not correct

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >What happened?
    Problem Exists Between Keyboard And Chair
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    I thought that the issue might be a same kind of problem in your another thread.
    Quote Originally Posted by Jack_Tauson_Sr View Post
    Hello,

    I'm executing following query:

    List the empno, ename, and dept name for any employees that work in the same department as CLARK.
    Use a subquery in the where clause to determine which department CLARK works in.

    Here is my query:

    Code:
    SELECT e.empno, e.ename, d.dname
    FROM EMP e , DEPT d
    WHERE d.DEPTNO IN (SELECT DEPTNO
                     FROM EMP 
                     WHERE EMPNO = 7782)
    AND d.DEPTNO = e.DEPTNO;

    But the problem with above query is that it is listing CLARK details as well. How can I omit CLARK details as I just want to display others who work with CLARK ?

    Thanks
    If so, PatP and I have provided some hints and examples.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •