Paper 2: Databases and SQL Flashcards

1
Q

What is a Database?

A

A store of data, normally a mix of text and numbers that can be easily searched.

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

What is a Flat file Database?

A

A database with one table of data on one particular topic.

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

What is a Relational database?

A

A database that can contain multiple tables on different topics that can then be linked together to make searching faster and more efficient.

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

What does a Table represent in a database?

A

Data stored on one particular topic, containing rows (Records) and columns (Field Names).

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

What are Field Names?

A

The headings for the Data that is going to be stored in that column.

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

What is a Field in the context of a database?

A

An individual cell of data in the database.

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

What is a Record?

A

Data on one item in the table (A row), which can contain multiple datatypes unlike an array in programming.

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

What is a Primary Key?

A

The unique field in a record, normally an ID.

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

What is a Datatype?

A

How the data will be stored.

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

What is a Query?

A

Searching the data for specific information.

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

What is Information in the context of databases?

A

Data arranged or collected together into a useful form.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
Q

What is SQL used for?

A

The programming language for setting up and using databases, and querying the database to find information.

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

What are the three main components of an SQL Query?

A
  • SELECT
  • FROM
  • WHERE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the SELECT statement do?

A

Will contain the field names we wish to include in the query, separated by a comma.

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

What does the FROM statement specify in an SQL Query?

A

The table name, which will always be included in an examination question.

17
Q

What is the purpose of the WHERE clause in SQL?

A

Contains the search criteria (What we are looking for) and is similar to an if statement in Python.

18
Q

True or False: Any word data in a WHERE clause is put inside quotes.

19
Q

Fill in the blank: In SQL, multiple search criteria are linked together using _____ or _____.

20
Q

Write the SQL query to display the surname and forename for all female employees who live in Birmingham.

A

SELECT surname, forename FROM tblEmployees WHERE Sex = “F” and City = “Birmingham”

21
Q

Write the SQL query to display all fields for employees who have been employed for 2 years or more and have salaries more than £50000.

A

SELECT * FROM tblEmployees WHERE Years in employment >= 2 and Salary > 50000