SQL Flashcards

1
Q

How do you create a database in SQL?

A

CREATE DATABASE example_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you create a Table with Columns and a designated Primary Key in SQL?

A

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)
);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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?

A

Primary Key and Foreign Key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

PRI

A

comes from primary; this means it’s a primary key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

UNI

A

comes from unique; this means it’s a unique key.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

MUL

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly