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 7623367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:41:21+00:00 2026-05-31T04:41:21+00:00

I have 3 tables. cinema, booking and customer create table cinema ( c_id int,

  • 0

I have 3 tables.
cinema, booking and customer

create table cinema
(
c_id int,
location varchar(10)
)
insert into cinema values(1,'New York');
insert into cinema values(2,'London');
insert into cinema values(3,'Paris');

create table booking
(
c_id int,
cust_id int
)

insert into booking values(1,10);
insert into booking values(2,11);
insert into booking values(3,12);
insert into booking values(3,13);
insert into booking values(2,14);

create table customer
(
cust_id int,
cust_name varchar(10)
)

insert into customer values(10,'sam');
insert into customer values(11,'adrian');
insert into customer values(12,'mark');
insert into customer values(13,'jim');
insert into customer values(14,'tom');

I want to select customer id(ie; cust_id), customer name(cust_name) and location(from cinema table) of all customer who have not booked in paris.

what i want is —

cust_id cust_name location
10      sam       New York   
11      adrian    London
14      tom       London

I tried a lot….
one of my code is —

SELECT customer.cust_id,customer.cust_name,
cinema.location as Location FROM booking,cinema,customer
WHERE booking.c_id=cinema.c_id AND location!='Paris';

it gives me 15 result..
I cant think how to do this..
please help me with this.

  • 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-31T04:41:22+00:00Added an answer on May 31, 2026 at 4:41 am

    In your code you’re not joining booking to customer, which is causing your problem. I use explicit joins as opposed to implicit here. Though there is no difference, the explicit syntax is standard.

    select cu.cust_id, cu.cust_name, ci.location
      from cinema ci
      join booking b
        on ci.c_id = b.c_id
      join customer cu
        on b.cust_id = cu.cust_id
     where ci.location <> 'Paris'
    

    I’m not entirely certain about the structure of your booking table. I would expect a few more columns, for instance number of tickets, etc.

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

Sidebar

Related Questions

I have tables foo and bar: create table foo(a int, b varchar(10), primary key
I have tables like tbl_biodata: id : int value=>1 name : varchar(50) value =>
I have tables in a MySQL database like this... CREATE TABLE `someUserTable` ( userId
I have Cinema table & City table and I have relation with this tables
I have tables like this: tblUsers int UserID string UserName tblUsersInRoles int UserID int
In my database I have tables that define types for example Table: Publication Types
When I have tables in my database that have PK/FK relationships (int) and when
I have 3 tables Links Link ID Link Name GroupID (FK into Groups) SubGroupID
I have tables named: Posts_August_2011 Posts_September_2011 Posts_October_2011 Posts_November_2011 Posts_December_2011 Posts_January_2012 I want to create
I have tables with latin1_swedish_ci column. I've done tests and inserted into them some

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.