3.7 relational databases and SQL

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/23

flashcard set

Earn XP

Description and Tags

Relational databases and SQL

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

24 Terms

1
New cards

Databases

a persistent(will stay until specifically deleted) store of organised data

2
New cards

Field (column)

a single type of data from a database table

3
New cards

Record

a set of related fields on a single entity within a database table

4
New cards

Table

a complete set of relateed records on the same topic

5
New cards

Primary key

a field that uniquely identifies a record in a table

6
New cards

Foreign key

the linking field in the foreign table formed when a relationship is made, the foreign key becomes the primary key of the new table

7
New cards

Data redundancy

data is repeated in a database table, making the database file much larger then necessary

8
New cards

Data inconsistency

the more redundant data there is, its more likely errors are introduced and that some of the data will be inconsistent

9
New cards

Relational database

made up of more than one table, removes data redundancy and inconsistency problems, each entity has its own table which refers to only one entity

10
New cards

What is SQL used for?

to access data stored in a data base

11
New cards

SELECT

identifies the fields to return from the database

12
New cards

FROM

identifies which table(s) the data will be returned from

13
New cards

WHERE

allows the programmer to include criteria, with only matching records being returned

14
New cards

ORDER BY

allows the programmer to put the data returned by the query into either ascending (ASC) or descending (DESC) order

15
New cards

Compulsory in an SQL query

SELECT and FROM

16
New cards

Not compulsory in an SQL query

WHERE and ORDER BY

17
New cards

Wildcards

special symbols used in searches

18
New cards

‘*‘ wildcard in SQL

used as SELECT* meaning all fields from the table should be returned

19
New cards

Extracting data from relational databases

an extra WHERE clause joins the primary key in one table to the foreign key in the other table

20
New cards

Extracting data from relational databases (SQL)

WHERE table1.primarykey = table2.foreignkey

21
New cards

What does the WHERE…AND clause do?

specifies further criteria if only certain records are required between the two tables

22
New cards

INSERT INTO…VALUES

used to add new records, full or partial, into a database table

23
New cards

UPDATE…SET…WHERE

used to update existing records in a database table

24
New cards

DELETE FROM…WHERE

used to delete records from a database table