SQL and databases Flashcards

1
Q

structured data

A

fixed fields with data types

has metadata

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

unstructured data

A

no discernible structure
no metadata
cannot be queried without being transformed

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

data base

A

collection of information that is organised so it can be accessed, managed and updated

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

field

A

column, single piece of data about an entity

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

records

A

rows, the group of fields about a specific entity

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

primary key

A

field that identifies each record uniquely

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

foreign key

A

field in one table that is the primary key in another table, links the tables together

specified by a *

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

why are data bases structured

A

unstructured information/data makes it hard to work with large datasets and to interpret

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

flat file data base

A

data base with one table

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

relational data base

A

has multiple tables that are connected through their key fields - foreign key

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

why use relational data bases

A
  • flat file data bases can lead to redundant data (repeats)

- inconsistencies likely to be introduced (as you have to manually add everything in so more likely to make mistakes)

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

SQL

A

structured query language

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

SQL select

A

SELECT Field(s)
FROM Table
WHERE Condition
ORDER BY Field ASC/DSC

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

What are the album titles stored?

A

SELECT Title

FROM Albums

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

What are the albums made after 2015, show the title and artist with newest first

A

SELECT Title, Artist
FROM Albums
WHERE Year > 2015
ORDER BY Year DESC

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

What are the song names stored, how many streams did they have and what album are they in?

A

SELECT Name, Stream_Count, Title
FROM Albums, Songs
WHERE Albums.ID = Songs.ID

17
Q

Who is the teacher and what room are 12B/It in?

A

SELECT Teachers.Name, Room
FROM Teachers, Classes
WHERE Classes.Name = “12B/It” AND Teachers.TeacherCode = Classes.TeacherCode

18
Q

INSERT INTO

A

Adds a record to a table

INSERT INTO Table (fields)
VALUES (values)

19
Q

a null field

A

gaps, empty field in record

20
Q

DELETE FROM

A

removes record from table

DELETE FROM Table
WHERE Field = Value

21
Q

UPDATE

A

changes value or values in table

UPDATE table
SET Field = Value
WHERE condition

22
Q

Change price of protractor to £2.99

A

UPDATE Products
SET Price = “£2.99”
WHERE Name = “Protractor”