database and design Flashcards

1
Q

what is a field

A

a field is a single piece of information; e.g. the name of a pupil (can be text,number,boolean,date,time)

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

what is a record

A

a record is all the information related to one item, object or person.

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

what is a table

A

a table is a collection of records

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

what is a flat file database

A

a flat file database is a database made up of one table of data

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

what is a relational database

A

a relational database is one that contains two or more linked tables of data these links are called relationships

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

relational databases prevent what

A

data duplication

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

what is an entity

A

an entity is a person, place, thing, event, concept that data is to be stored on in a school database entities might include CLASS, PUPIL, TEACHER (table names)

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

what is an entity occurrence

A

entity occurrence is a specific example of an entity. each row in a database contains information describing one entity occurrence

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

what is an attribute

A

an entity is described by attributes. attributes become Collums (fields)
An attribute is a single piece of information about that entity

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

what is an entity in terms of attributes

A

an entity is described by attributes. attributes become Collums (fields) imagine a pupil entity, it would have attribute of DoB and Grades (field names)

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

what is a primary key

A

a primary key is a field that uniquely identitfies one record (or entity occurance)

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

what is a foreign key

A

a foreign key is a field that is linked to another tables primary key. e.g. a primary key used in another table to link the two tables. any value in the foreign key should match that of the primary key in the other table

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

what are end user requirements

A

the end users are the people who are going to be using the database

their requirements are the tasks they expect to be able to do whilst using the database for example: preforming searches
sorting a database or using the database to preform calculations

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

what are functional requirements

A

functional requirements are the processes and activities that the database has to perform in order to meet the end user requirements

it will also need to reference the information that the system has to contain to carry out its functions

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

what is cardinality

A

cardinality is the relationship between tables including one to one relationships and one to many relationships

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

what is a compound key

A

a compound key is a primary key that comprises of two or more attributes with each of these attributes being primary keys themselves and is used to link many tables

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

what is an entity occurrence diagram

A

an entity occurence diagram is a method of identifying the relationship between entities . it is a tall oval with the entities listed inside and lines are drawn between the entities to show cardinality and relationship

18
Q

what is an entity relationship diagram

A

is used to show the enitites and attributes of the database and the relationship between them

19
Q

what are the 4 types of validation

A

presence check - checks for presence
restricted choice - usually uses a drop down menu
length check - checks that it is a certain length
range check - checks values are within a certain range

also know look up from

20
Q

data dictionary

A

a data dictionary is a design notation for data modelling during the design of the database

a data dictionary includes names and description of the tables and fields and any relationships

21
Q

what does SELECT command do

A

The SELECT command is used to choose with feilds to display

22
Q

What does the FROM command do

A

the FROM command states where any information used within the query is from

23
Q

what does the WHERE command do

A

the WHERE command states conditions that must be met for attributes to be displayed

24
Q

what is an equi join

A

an Equi join is used when you need to display fields from related records from linked tables. it is used in the where statement and consists of saying that one tables compound key equals the other

25
Q

What is the LIKE statement

A

the LIKE statement is used to preform search operation in the WHERE clause with the % symbol representing any number of characters and _ representing one character

finding a name with the second last letter being a w would look like this WHERE name LIKE ‘%w_’

26
Q

what does the AS statement do

A

the AS statement is used to create aliases with the syntax looking like SELECT name AS [pupilName]

27
Q

what are the aggregate functions

A

AVG COUNT MIN MAX SUM

28
Q

what does AVG do

A

finds and displays the average of a certain field has to be numerical
: AVG(money)

29
Q

what does COUNT do

A

COUNT displays how many occurrences there are of a certain field works with any data type :
COUNT (pupils)

30
Q

what does SUM do

A

SUM reterns the value of every value in a field added together only works with numerical data types : SUM(prices)

31
Q

what does MIN/MAX do

A

MIN returns what the minimum value of a field and MAX returns the Maximum value : MIN(price)

32
Q

what does ROUND do

A

ROUND rounds a value to a certain number of digits : ROUND(price,2) this would round to two sig figs

ROUND(AVG(price), 2) also works

33
Q

using results of queries in other queries

A

you need to put the name of the query in square brackets in the FROM clause and the name of the field in square brackets where it is wanted to be used

34
Q

why use the result of queries in other queries

A

when aggregate functions want to be used outside the SELECT clause

35
Q

what does GROUP BY do

A

it is used to form groups of records . is needed when using more than one aggregate functions is used as its own clause

36
Q

what does UPDATE clause do

A

UPDATE allows you to edit what the values within an existing record are syntax looks like this :
UPDATE customer
SET address = ‘123 Dundee road’ ,postcode = ‘dd6 7hj’
WHERE name LIKE ‘W%’

37
Q

what does DELETE clause do

A

DELETE permanently deletes things:
DELETE *
FROM Accounts
WHERE name = ‘will boyle’

38
Q

how to select all of something

A

*

39
Q

how to use addition subtraction multiplication and division

A

SELECT (price * quantity )
FROM customer
WHERE (x+y) = 5

40
Q

what does INSERT do

A

insert allows you to add new records into database :
INSERT INTO customer
(CustomerNo,FirstName,Surname,AdressTown) VALUES (‘583’,’Ron’,’Swanson’,’123 adress street’,’dd6 blah blah blah’)