SQL Flashcards

1
Q

define relational database

A

database that organizes information into one or more tables

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

what does sql stand for

A

structured query language

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

Describe the flow of the relational database management system

A

the relational database stores data in tables, and these tables provide data for view by queries. these queries can change the table, format data from table into reports, or organise data sequentially into procedures

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

what are fields

A

a fixed number of columns, in each of which is a fixed data type

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

what is a primary key

A

a field, or collection of fields,
whose data uniquely identify a record. primary key usually shown in bold. the column that is unique to each record in the table.

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

what are records

A

an unlimited set of rows, each row containing data in each column of a prescribed type

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

what is a foreign key

A

a field that refers to a primary key in another table

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

what is a schema

A

a map of tables, fields, and

relationships in a relational database

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

how do you capture many to many relationships in sql?

A

In general, if you have many-to-many relations,
you will need an extra table — junction/join table. One primary key has multiple fields: no one field by itself
is unique in the table

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

are sql words case sensitive

A

NO

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

difference between query and view

A

query is temporary, view can be saved and opened again

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

if you delete info using a query in sql, does it change the result in the table permanently

A

yes

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

what is the main principle in database design

A

do not duplicate data. cos 1) error rate high 2) waste memory 3) time consuming, need to change everything when you have one change. Good database design separates related data into tables so that the data are not needlessly repeated

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

describe the four types of sql joins

A

inner join: matching records from both tables
left join: all records from left table, and matching records from right
right join: all records from right, and matching records from left table
full outer join: all records, when there is either a match in left or right table

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