Topic 7 - Databases and SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a database?

A

A structured way to store data so that it can be retrieved using queries

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

What is the difference between Char and VarChar?

A

Char is fixed length string
VarChar is variable length string

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

What is a flat file database?

A

A database that stores a single table pf data inside a single text file in CSV format

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

What is a primary key?

A

A field in a database that holds a unique value

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

What is the issues with flat file databases?

A

Inconsistences
Redundancy

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

What is a relational database?

A

A database that contains multiple tables which have links know as relationships.
Each table is a relation

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 in a table that refers to the primary key in another table

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

What can relationships in a table be?

A

One-to-One
One-to-Many
Many-to-Many

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

What is SQL?

A

Structured Query Language
A language that allows us to create, select, update, insert and delete data in a database

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

What does a wildcard (*) do?

A

Selects all fields

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

Write the SQL for select

A

SELECT
FROM
WHERE

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

What does LIKE do in a select?

A

Searches for a pattern

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

What does BETWEEN do in a select?

A

Selects an inclusive range

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

Write the SQL for update

A

UPDATE
SET
WHERE

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

Write the SQL for delete

A

DELETE FROM
WHERE

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

Write the SQL for insert

A

INSERT INTO
VALUES