From the course: SQL: Data Reporting and Analysis
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
EDIT: Visualize your database - SQL Tutorial
From the course: SQL: Data Reporting and Analysis
EDIT: Visualize your database
- [Instructor] Now that we understand a bit more about keys, indexes, and constraints, we're going to move on to see how our tables link together. We're going to look at a diagram that shows all of the tables and all of the links. And we're going to do that using a common database diagram. Here we are representing the rental table as a box, and in the shaded area at the top you can see the name of the table, it's rental, and then within the paler region underneath, we have rental_id, which is the primary key, P for primary, and three foreign keys listed with an F for foreign. If we go and have a look at the rental table in the structure tab, we can see we have a rental_id, which is a primary key, inventory_id, customer_id, and staff_id, so three foreign keys, so that's where I've got that information from to draw that box. I'm not listing any other indexes, such as rental date, in my diagram, because they are indexes and…
Contents
-
-
-
-
-
-
(Locked)
Make your queries faster1m 47s
-
(Locked)
Understand SQL indexes and keys7m 16s
-
(Locked)
EDIT: Visualize your database7m 58s
-
(Locked)
Merge data across tables with JOIN5m 2s
-
(Locked)
Understand SQL JOINS4m 16s
-
(Locked)
Combine rows with SQL UNION4m 49s
-
(Locked)
Merge data across tables with IN2m 11s
-
(Locked)
Select from a selection with subqueries2m 56s
-
(Locked)
Challenge: Join tables1m 4s
-
(Locked)
Solution: Join tables4m 37s
-
(Locked)
-
-