From the course: PostgreSQL Essential Training
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Solution: Execute a command on the Postgres server - PostgreSQL Tutorial
From the course: PostgreSQL Essential Training
Solution: Execute a command on the Postgres server
(upbeat music) - [Instructor] I hope you were able to add in a pair of tables to the Kinetico database. Here's how I go about it. Now, in creating our tables with relationships between them it usually makes it a little bit easier to think about the columns that'll relate to one another. Figure out which table has the foreign key and which one has the primary key. Then create the table with the primary key values first. In the case of this challenge, that means that we should create the department's table first. So in order to do that, we're going to go into the Kinetico database and find our schemas collection. Here we have the human resources schema. I'll right click on that, point to create and choose table. All right, so we're going to create a new table for departments. Then we'll go over here to the columns section and we're going to add in a couple of columns. I asked for three individual columns for this challenge…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Organize tables with schemas6m 35s
-
(Locked)
Create a table with pgAdmin6m 57s
-
(Locked)
Link primary and foreign keys6m 38s
-
(Locked)
Enforce referential integrity on related records6m 24s
-
(Locked)
Challenge: Execute a command on the Postgres server55s
-
(Locked)
Solution: Execute a command on the Postgres server5m 19s
-
(Locked)
-
-
-
-