Databases Flashcards

1
Q

table consists of these two things

A

columns and rows

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

columns are known as what

A

fields

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

rows are known as what

A

records

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

difference bw spreadsheet and db

A

db can define and traverse relationships between tables

issue commands to interact

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

what is a database

A

set of tables

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

column

A

set of data of single simple type

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

row

A

single record of data like “Kevin”

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

field

A

intersection of c and r

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

index

A

data structure on a table to increase lookup speed

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

foreign key

A

table column whose values reference rows in another table.

foundation of relational dbs

example table:pages
subject_id referencing subject table (singular nomenclaure)

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

a foreign key should always have what

A

indexes so you can find relationships quickly

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

schema

A

structural definition of a db, defines table, columns, rows, etc, everything that makes up the structure of a database

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

if you import a schema what happens

A

creates complete db with correct structure, but without data

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

CRUD

A
create
read
update
delete
(fundamental way of interacting with a db)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

grant privelages

A

gives privelages for something like a db.* (*is wild card so all tables on that db)

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

1-1 db

A

classroom:teacher – A classroom has one teacher, a teacher belongs to a classroom,fk goes to teachers table

to find the teacher you could use fk to match pk of classroom and vice versa

17
Q

foreign key always belongs to the child

A

true

18
Q

1-many

A

teacher has many courses, course velongs to teacher, fk goes on courses table

the fk is the id of the teacher

19
Q

many to many association

A

course has many students, and also belongs to many students, a student has many courses and also belongs to many courses

interrelation which would mean two fk’s that go into a join table (third table to make relationships)

to look up, take michaels fk, then find courses with same key