SQL Flashcards
How do you create a database in SQL?
CREATE DATABASE example_name
How do you create a Table with Columns and a designated Primary Key in SQL?
CREATE TABLE table_name (
row_name_one DATA TYPE(100),
row_name_two DATA TYPE(200,
row_name_three DATA TYPE(300),
PRIMARY KEY (row_name_one)
);
You have three tables called Course, Student and Enrollment. These tables need to be linked with each other. Which of the following keys can you use to establish these relationships?
Primary Key and Foreign Key
PRI
comes from primary; this means it’s a primary key.
UNI
comes from unique; this means it’s a unique key.
MUL
comes from multiple. If the key is MUL, it means that the related column is permitted to contain the same value in multiple cells of that column.