AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Success stories
Activities
Reviews
Subscriptions
Light theme
Lectures
Reviews
About us
CS50
Start
Start learning
Start learning
My progress
Courses
Quest map
Lectures
SQL
SQL
Level 19
Foreign Keys:
FOREIGN KEY
SQL SELF
19 level,
0 lecture
In this article, you'll find out what foreign keys are in relational databases, why you need them, how to use them to link tables and keep your data consistent, plus you'll see examples of different types of relationships and the syntax for creating foreign keys in PostgreSQL.
Creating Foreign Keys When Creating Tables
SQL SELF
19 level,
1 lecture
Learn how to create foreign keys in PostgreSQL, why you need them, and how to use them right to keep your data solid and organize relationships between tables. Examples, syntax, practical tips, and common mistakes — all in one lecture!
Using
ON DELETE CASCADE
and
ON UPDATE RESTRICT
SQL SELF
19 level,
2 lecture
Learn how to manage relationships between tables in relational databases using cascade operations and constraints. We'll break down, with examples, how to automate deleting related data and protect data integrity when making changes.
Modeling a
ONE-TO-MANY
Relationship Between Tables
SQL SELF
19 level,
3 lecture
Learn how to set up one of the most common relationships in relational databases —
one to many
(
ONE-TO-MANY
). Using customers and orders as an example, we’ll break down creating tables, adding foreign keys, inserting and selecting data, plus typical mistakes and how to dodge them.
Modeling a MANY-TO-MANY Relationship Using a Join Table
SQL SELF
19 level,
4 lecture
Learn how to properly implement a "many-to-many" relationship in relational databases using a join table. Examples of creating tables, inserting data, and running SQL queries for managing these relationships like a pro.
Please enable JavaScript to continue using this application.