Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4531802
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:56:56+00:00 2026-05-21T13:56:56+00:00

I have this tables Movie a id title yr score votes — ————– —-

  • 0

I have this tables

Movie a
id  title           yr    score  votes
--  --------------  ----  -----  -----
1   ‘Harry Potter’  1985  9.98   2
2   ‘Beasdas’       1985  5.28   3

actor b
id  name
--  --------------
1   ‘Keanu Reeves’

casting c
movieid  actorid  ord
-------  -------  ---
1        1        2

I want to List the film title and the leading actor for all of ‘Julie Andrews’ films.
Is this correct?

SELECT title, name
   FROM movie a, actor b, casting c
   WHERE title IN(SELECT title
                  FROM movie a, actor b, casting c
                  WHERE name = 'Julie Andrews' AND
                             a.id = c.movieid  AND
                             b.id = c.actorid) AND
                                         ord = '1' AND
                                         a.id = c.movieid AND
                                         b.id = c.actorid;    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T13:56:57+00:00Added an answer on May 21, 2026 at 1:56 pm

    If you want all results where ‘Julie Andrews’ is the lead actor then this is what you need:

    SELECT a.Name, m.Name
    FROM Actor a
    INNER JOIN Casting AS c ON a.actorid = a.id AND c.ord = 1
    INNER JOIN Movie AS m ON m.id = c.movieid
    WHERE a.name = 'Julie Andrews'
    

    On the other hand if you need all films where ‘Julie Andrews’ had a role, but not necessarily being the lead actor then you need the following:

    SELECT m.Title, a2.Name 
    FROM Movie AS m
    INNER JOIN Casting AS c1 ON c1.movieid = m.id
    INNER JOIN Actor AS a1 ON a1.id = c1.actorid AND a1.name = 'Julie Andrews'
    INNER JOIN Casting AS c2 ON c2.movieid = m.id AND c2.ord = 1 
    INNER JOIN Actor AS a2 ON a2.id = c2.actorid
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Movie table & TblMovieVideos table and I have relations with this tables,
i have this three tables. Table: Item Columns: ItemID, Title, Content, NoChange (Date) Table:
I have this SQL Server query which I wrote to find the Movie title
Okay so I have this code here: SELECT MOVIETITLE AS Movie Title, MIN(AVG(RATING)) AS
I have this tables: movie, session (a movie displayed at a datetime) and User.
I have this two tables: Table A ID TYPE SDATE EDATE RATING 1 M
I have this two tables from my program to manage stock: Articulos (items): id_articulo
you have this 2 tables: table1 ------------- id fromId fromOtherTableId person and Table2 -------------
I have this mysql tables I want to display with jqgrid. The problem appears
Hello I have like this 2 tables class User public int UserId{get;set;} { ....

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.