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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:26:33+00:00 2026-06-12T19:26:33+00:00

When we do a query such as this SELECT COUNT(*) FROM A, B, C

  • 0

When we do a query such as this

SELECT COUNT(*)
FROM A, B, C
WHERE A.type = B.type
AND B.cost = C.cost

What can we say about the result table? What will the size of the result table be?
If A has 5 rows, B has 8 rows, and C has 7 rows

EDIT: Can I please get some response instead of mark down? I am total new to SQL and need help.

EDIT2: What I am trying to do – Understand how WHERE and AND clause works & why the result table has 8 rows

How you came to this particular question – I was reading my textbook and doing the questions in it

What I’ve tried to solve it – I tried Google and reading various of posts but most of them just shows HOW to do it instead of explaining what’s actually happpening

  • 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-06-12T19:26:35+00:00Added an answer on June 12, 2026 at 7:26 pm

    The count will be the number of common values . E.g. Consider this small example

    DECLARE @A Table(Val1 Int)
    Insert Into @A Values(1),(2),(3),(4),(5)
    
    
    DECLARE @B Table(Val2 Int)
    Insert Into @B Values(1),(2),(3),(4),(5),(6)
    
    
    DECLARE @C Table(Val3 Int)
    Insert Into @C Values(1),(2),(3),(4),(5),(6),(7)
    
    
    SELECT COUNT(*)
    FROM @A a, @B b, @C c
    WHERE a.Val1 = b.Val2
    AND b.Val2 = c.Val3
    

    The result is 5. Because a.Val1 = b.Val2 has 5 common elements viz 1,2 3,4,5. Now b.Val2 = c.Val3 has 6 common elements viz 1,2,3,4,5,6.

    Then these two result sets will act upon each other and will try to get the intersecting values i.e. common values which is again 1,2,3,4,5. Hence is the count as 5

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

Sidebar

Related Questions

If I run a query such as: SELECT COUNT(*) as num FROM table WHERE
How can I do such query in Postgres? IF (select count(*) from orders) >
This is the query I'm talking about: SELECT COUNT FROM Note N, DatePCC D
I have this such query : SELECT au_lname,der.col FROM authors INNER JOIN (SELECT t.au_id,
Consider This Query: SELECT [Order Details].OrderID, c.CategoryName, COUNT(c.CategoryID) FROM [Order Details] INNER JOIN Products
If I have a query such as : select * from tbl where id
Anyone knows how to perform such query in Postgresql? SELECT * FROM tabA WHERE
I am using the following query: SELECT (SELECT COUNT(*) FROM blah WHERE MATCH(text) AGAINST
I have a query which is crossing two tables select count(*) from ingenium.empevt, ingenium.evt
In SQL Server, you can write nested SQL like this: SELECT T.con FROM (SELECT

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.