Viral Hooks
Trending short videosSQL tutorial: check data sharing
A

@arrionknight

Instagram · Screen Recording

@arrionknight SQL Composite Key Primary Key and Foreign Key example‼️ #sql #python #hoodcoding #computerscience #compsci

View original on Instagram

The edit1 shot · 88 text
Shots Text

Performance

Views
104K
Likes
5.6K
Comments
50
Engagement
5.5%

Video #11956 · Screen Recording

SQL tutorial: check data sharingfrom @arrionknight

[01]

Overview

The speaker explains how to use SQL to check if data is being shared. He creates two tables, 'Huzz' and 'Sharks', and sets up primary and foreign keys to ensure data integrity. He demonstrates how to create a query to check if the 'Huzz' are going, using sample data and showing how the foreign key constraint prevents incorrect data entry.

[02]

Simple outline

  1. 1Define data structure
  2. 2Create related tables
  3. 3Insert sample data
  4. 4Demonstrate constraint failure
  5. 5Explain query logic

[03]

Related videos

[04]

Classification

Concepts
Tutorial / How To
Elements
Text Overlay

[05]

Hook analysis

What stops the scroll in the first 3 seconds

Title hook · 55%

Check if Huzz are going...

Verbal hook · 40%

This is how you find out if the huhs are going.

Visual hook · 5%

Close-up shot of the speaker with braided hair and a black Adidas shirt, speaking directly to the camera.

[06]

Hook template

Steal this for your own video

This is how you check if your [data object] are going to [destination or process].

  • — This is how you check if your leads are going to your CRM.
  • — This is how you check if your payments are going to the right account.
  • — This is how you check if your form submissions are going to your database.

[07]

Hook and payoff

The promise the opener makes, and how the video pays it back

Hook

State the problem of data sharing and introduce SQL as a solution.

Payoff

Explain how the query identifies invalid data based on the table relationships.

[08]

Narrative framework

The structural pattern this video runs on

Framework

SQL Data Integrity Check

Demonstrates how to use SQL constraints to ensure data integrity and prevent invalid relationships between tables.

  1. 1

    Table Definition

    Create the first table with a primary key to store basic information.

  2. 2

    Relationship Setup

    Create a second table with a foreign key referencing the first table's primary key to establish a relationship.

  3. 3

    Composite Key Explanation

    Explain the concept of a composite primary key.

  4. 4

    Data Insertion Attempt

    Attempt to insert invalid data that violates the foreign key constraint.

  5. 5

    Constraint Demonstration

    Show the error message resulting from the constraint violation.

  6. 6

    Query Explanation

    Explain the query used to check data integrity.

Themes

  • data management
  • programming
  • database design

Techniques

  • screen recording
  • voiceover
  • code demonstration

Trends

  • coding tutorials
  • SQL
  • data science

Post caption

SQL Composite Key Primary Key and Foreign Key example‼️ #sql #python #hoodcoding #computerscience #compsci

Text overlays

  • title · beginning

    Check if Huzz are going...

  • informational · beginning

    THIS IS HOW

  • informational · beginning

    HUZZ ARE GOING

  • informational · beginning

    IF YOU WANNA MAKE SURE

  • informational · beginning

    YOU'RE NOT SHARING

  • informational · beginning

    YOU GOTTA

  • informational · middle

    SO THE FIRST THING

  • informational · middle

    WE'RE GONNA

  • informational · middle

    CALLED

  • informational · middle

    WE'RE GONNA

  • informational · middle

    FIRST NAME AND

  • informational · middle

    THE LAST

  • informational · middle

    ALL

  • informational · middle

    AND

  • informational · middle

    AND WE MAKE THE

  • informational · middle

    KEY

  • informational · middle

    THIS NEXT PART IS

  • informational · middle

    IMPORTANT TO SEE

  • informational · middle

    IF THE HUZZ ARE

  • informational · middle

    SO NOW

  • informational · middle

    ANOTHER

  • informational · middle

    AND IN THE SHARKS

  • informational · middle

    GONNA HAVE THE

  • informational · middle

    AND THE PRIMARY

  • informational · middle

    GONNA BE

  • informational · middle

    GONNA BE A

  • informational · middle

    COMBINATION

  • informational · middle

    THE SHARK

  • informational · middle

    AND THE HUZZ

  • informational · middle

    WE CALL THIS

  • informational · middle

    PRIMARY

  • informational · middle

    IN THE SHARK'S

  • informational · middle

    GONNA MAKE OUR

  • informational · middle

    FOREIGN

  • informational · middle

    GONNA

  • informational · middle

    GONNA REFERENCE

  • informational · middle

    THE ID

  • informational · middle

    SO NOW

  • informational · middle

    SAMPLE

  • informational · middle

    SAMPLE HUZZ AND

  • informational · middle

    SOME SAMPLE

  • informational · middle

    SHARKS IN THE

  • informational · middle

    AND YOU SEE

  • informational · middle

    AND YOU SEE IF WE

  • informational · middle

    TRY TO ENTER A

  • informational · middle

    SHARK LINK TO THE

  • informational · middle

    SHARK LINK TO THE

  • informational · middle

    HUZZ ID FOUR

  • informational · middle

    BECAUSE

  • informational · middle

    BECAUSE

  • informational · middle

    BECAUSE WE DON'T

  • informational · middle

    BECAUSE WE DON'T

  • informational · middle

    HAVE THE

  • informational · middle

    HAVE THE

  • informational · middle

    BECAUSE WE DON'T

  • informational · middle

    HAVE THE ID

  • informational · middle

    FOUR

  • informational · middle

    IN OUR HUZZ

  • informational · middle

    TABLE

  • informational · middle

    AND NOW

  • informational · middle

    AND NOW WE

  • informational · middle

    AND NOW WE

  • informational · middle

    AND NOW WE

  • informational · middle

    COULD CREATE

  • informational · middle

    THIS QUERY

  • informational · middle

    TO CHECK IF THE

  • informational · middle

    HUZZ

  • informational · middle

    ARE GOING

  • informational · middle

    SO

  • informational · middle

    SO

  • informational · middle

    SO

  • informational · middle

    SO WE WANNA

  • informational · middle

    SO WE WANNA

  • informational · middle

    SELECT THE HUZZ

  • informational · middle

    AND WE WANNA

  • informational · middle

    SHARKS

  • informational · middle

    TO THAT

  • informational · middle

    TO THAT

  • informational · middle

    TO THAT HUZZ ID

  • informational · middle

    THAN

  • informational · middle

    THAN

  • informational · middle

    THAN ONE SHARK

  • informational · middle

    THAT

  • informational · middle

    THAT

  • informational · middle

    THAT

  • informational · middle

    IS

  • informational · middle

    IS

  • informational · middle

    IS

Transcript

This is how you find out if the huhs are going. If you wanna make sure that you're not sharing the huhs, you gotta be using SQL. So the first thing we gotta do, we're gonna create a table called huhs, and we're gonna store the ID, the first name, and the last name of all the huhs there. There. And we make the ID our primary key. This next part is important to see if the huhs are going. So now we're gonna create another table called sharks. And in the sharks table, we're gonna have the shark name. We're gonna have the hose ID, and the primary key this time is gonna be a combination of the shark name and the HUD's ID. We call this a composite primary key. In the sharks table, we're gonna make our HUD's ID our foreign key, and it's gonna reference the ID column in the HUD's table. So now we're gonna put some sample and some sample sharks in the table. And you see if we try to enter a shark linked to the ID four, we can't because we don't have the ID four in our table. And now we could create this query to check if the are going. So we wanna select the HUDs ID, and we wanna count how many sharks are linked to that HUDs ID. And if it's more than one shark, it means that that HUDs ID is going.

SQL tutorial: check data sharing | Viral Hooks