Database queries Flashcards

(14 cards)

1
Q

What is a database query?

A

A question used to retrieve selected information from a database.

A query can involve various conditions to filter the data returned.

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

What does the condition ‘=’ signify in a database query?

A

Equal to.

This condition is used to match values exactly.

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

What does the condition ‘BETWEEN’ indicate in a database query?

A

Numbers between x and y.

This is used to filter records within a specific range.

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

What does the condition ‘AND’ require in a database query?

A

Both conditions must be true.

This condition is used to narrow down results by requiring multiple criteria.

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

What does the condition ‘OR’ allow in a database query?

A

Either one of the conditions must be true.

This condition broadens the search by allowing multiple criteria.

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

What does the condition ‘>’ mean in a database query?

A

Greater than.

This condition is used to filter records with values exceeding a specified number.

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

What does the condition ‘<’ mean in a database query?

A

Less than.

This condition filters records with values below a specified number.

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

What does the condition ‘>=’ indicate in a database query?

A

Greater than or equal to.

This condition includes the specified number in the results.

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

What does the condition ‘<=’ signify in a database query?

A

Less than or equal to.

This condition includes the specified number in the results.

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

What are the two types of queries in databases?

A
  • Simple: using one table & criteria
  • Complex: using more than one table & search criteria

Simple queries are straightforward, while complex queries involve multiple tables and conditions.

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

Complete the query to find all female customers.

A

Complete the query below so that only females customers will be displayed.

This query needs specific criteria for filtering gender.

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

Complete the query to return people living in Belfast with insurance.

A

Complete the query below to return people who live in Belfast and have Insurance.

This query combines location and insurance criteria.

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

Complete the query to return all females born between specific dates.

A

Complete the query to return all females customers born between 01/01/1975 and 01/01/1985.

This query filters based on gender and birthdate range.

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

Complete the query to find females from Omagh with insurance.

A

Complete the query to return all females, from Omagh who have insurance.

This query combines gender, location, and insurance criteria.

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