Joining and matching tables in SQL with query

Joining and matching tables in SQL with query

So im trying to select multiple tables and do a comparison between starNumb, mvNumb from Star table and Movie table, if the two match I then want it to return / display the starName along with a total count of how many times that StarName is related to mvNumb if that makes sense.

So im trying to select multiple tables and do a comparison between starNumb, mvNumb from Star table and Movie table, if the two match I then want it to return / display the starName along with a total count of how many times that StarName is related to mvNumb if that makes sense.

So far I have this and it's not playing ball, I'm sure this is something very simple but struggling.

SELECT STARNUMB.STAR, MVNUMB.MOVIE
FROM MOVIES JOIN STAR
where STARNUMB = MVNUMB;

What I want from this is something that looks like this below as an output.

Column1 StarName = TestName1

Column2 MovNumb = 1

Meaning that star has appeared in the movie 1 x time.

The tables and FD's look something like this:

Bold = Primary keys

  • Star(starNumb, starName, brthPlce, starBorn, starDied)
  • MovStar(mvNumb*, starNumb*). <----- foreign keys
  • Movie(mvNumb, mvTitle, yrMde, mvType, crit, mpaa, noms, awrd, dirNumb*)
  • Borrow(txNumb, mvNumb*, borDte, mmbNumb*)
  • Member(mmbNumb, mmbName, mmbAddr, mmbCty, mmbSt, numRent, bonus, joinDate)
  • Director(dirNumb, dirName, dirBorn, dirDied)**


sql oracle

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

Introduction to Structured Query Language SQL pdf

SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.

Welcome Back the T-SQL Debugger with SQL Complete – SQL Debugger

Debug SQL stored procedures and develop your SQL database project with dbForge SQL Complete, a new add-in for Visual Studio and SSMS. When you develop large chunks of T-SQL code with the help of the SQL Server Management Studio tool, it is essential to test the “Live” behavior of your code by making sure that each small piece of code works fine and being able to allocate any error message that may cause a failure within that code.

3 Tips to Write SQL Queries That Are Easier to Read and Modify

3 practice tips to write SQL queries which are easier to read and modify even after six month and one year. Use this tips to write professional quality SQL.There is no doubt that writing code is more art than science and every coder cannot write beautiful code which is both readable and maintainable, even with the experience.

The Easy Guide on How to Use Subqueries in SQL Server

This article provides an outlook on various types of subqueries in SQL such as select or other T-SQL statements and caveats when using them.