


The primary key is special in that it is used for identification. 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. Now, you’ll need to create a table in order to add some actual content to your database.In order to work with the database your have just created, use the command “USE” and type USE classmate_database and run the command just as you did before.
PSEQUEL MAC OS PRO
To check that you’ve successfully created the database, navigate to the “TABLES” section of the Sequel Pro window and locate classmate_database. To create your database, type CREATE DATABASE classmate_database then press “Run Previous” just below in order to run your code and create your database. In this demo, I will create a database of classmates, but feel free to mimic the syntax used in order to create a database of your choosing. Once connected, you will automatically be in the “Query” section of Sequel Pro, where you will type and run MySQL commands.Create a Standard connection to your MySQL Server, using IP address 127.0.0.1 as the Host and your MySQL root credentials for the Username and Password.

See this walkthrough for assistance in doing so.
