14.05 Relational Databases + 14.06 Performing Searches Flashcards

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

What is a ‘relational database’?

A

A database that contains more than one table. However the tables are linked using their primary keys.

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

Where might a ‘relational database’ be used?

A

For example in a vet’s where there could be 3 fields of information required, eg:

Table: Primary Key: Data Stored:

Owner # Name/address/phone/pet#

Pet # Name/breed/species/owner#

Appointment # Time/date/pet#

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

Diagram to show how the tables are linked…

A

OWNER TABLE PET TABLE APPOINTMENT TABLE
Owner # ———–>Owner #—–>Pet #
Owner name Pet name Vet name
Owner address Pet bread Time
Owner phone Pet # Date

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

Explanation of the diagram…

A

By looking up the owner by name or phone number etc we can find information about the pet and again via the primary key information can be found out about the appointment time.

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

Advantages of Relational Databases…

A
  • Data only needs to be entered once, and more information can be added about it, an owner already on the database can then ‘register’ another pet without needing to re enter information about themselves.
  • Entering the data once means there will be less data errors made, if the information about the pet and owner had to be entered everytime there is an appointment, then it is lightly that errors would be made in entering this information each time.
  • If data was entered incorrectly, if the pets name was entered incorrectly it only has to be corrected in one place, in a normal line database the pets name would have to be corrected under each appointment field.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a ‘query’?

A

A method/way of searching a database

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

What is ‘SQL’?

A

A specialised programming language for maintaining databases and generating queries

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

What does ‘Query-by-example’ mean?

A

A method of searching a database by stating the criteria to be searched, eg by appointment time or pet bread.

The areas that could be searched for/in are:

  • The table
  • The field
  • The criteria
  • Any sorting that we want to apply
  • If a particular field is required in the search results (hide the certain fields)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a table of students at a school, how could a query-by-example be used?

A

If there was a field of exam results that could be searched in, the query-by-example could be used to find groups of students by ability. The criteria could be to show students with more than 55% but less than 74% average score. This could be used with different results brackets to set classes for the next year/term based on results in previous exams.

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

What is an operator?

A
An operator id used to search for values in the table . 
=         Equal to 
>         Greater than 
<         Less than 
>=       Greater than or equal to 
<=       Less than or equal to 
AND   Combines 2 criteria 
OR      Either one criteria or another
NOT   Excluding a criteria  

This could be used to find students who need to retake exams?

Re-sit = a result <50%

Criteria = ‘re-sit’ = yes?

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