Class 06 Flashcards

docker database

1
Q

what is char(n)?

A

fixed string

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

what is varcar(n)?

A

variable string

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

what is a float?

A

real numbers

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

what should always be included in a table?

A

a primary key

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

what is a unique constraint?

A

you want something to appear once

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

what is a foreign key?

A

reference to another table

(can match primary key values in other tables + may have nulls)

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

what is “not null”?

A

a participation constraint useful for attributes

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

what is “current_timestamp” useful for?

A

time stamps you can backtrack to

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

what is “alter table” for?

A

allows to modify a table structure

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

what is “add” for?

A

“add” a new field

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

what is “insert into (2)” for?

A

inserts tuples into tables

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

how can you update your code?

A
  1. “update” relation
  2. “set” list_on_assignments
  3. “where” selection_condition;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what does “delete” do?

A

removes matching rows from a table where conditions are met

  1. “delete from” person
  2. “where” id = ‘1234’ ;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what does “truncate table” do?

A

removes all data rows in a table but the table still exists (schema (structure) remains the same)

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