![]() Here, that means that no students can have the same ID and that no students can have the same last name (which may not be a realistic assumption). Both primary and unique keys are indices whose members must all be unique. CREATE DATABASE is self explanatory however, it’s important to notice the way we set student_id as the PRIMARY KEY here and set student_lastName as a UNIQUE key. Let’s take some time to understand the code we’ve just used. To create the table, unsurprisingly, we’ll use the command “CREATE TABLE” to create a table of classmates and proceed to indicate the primary key column and an initial (unique) column for the database. ![]() To learn more about the organization of a database or, more specifically, the relationship between a database and its tables, check out this post.
0 Comments
Leave a Reply. |