7. Relational databases and structured query language (SQL) Flashcards

1
Q

What is a database?

A

an organized collection of structured information, or data, typically stored electronically in a computer system

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

Give 3 examples of a database:

A
  • Classcharts
  • SIMS
  • NHS records
  • Government records
  • Library book records
  • Social Media accounts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a relational database?

A
  • a collection of data items with pre-defined relationships between them
  • Data is typically structured across multiple tables, which can be joined together via a primary key or a foreign key.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the advantages of a relational database over a flat file database? (main two, but try four)

A
  • no inconsistencies in the data
  • no redundant data
  • more data can be handled
  • increased speed and performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a flat file database?

A

a database that stores a single table of data inside a single file text

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

what is a table?

A

The component in which all the data is stored

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

what is a record?

A

an individual collection of all the data for one person/item (basically a row)

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

what are all the possible data types in a database?

A
  • integer (for a whole number)
  • real/float/decimal (for a decimal)
  • char (for a fixed amount of characters of an alphanumeric string up to 8,000 characters)
  • varchar (for an unfixed amount of characters of an alphanumeric string up to 8,000 characters)
  • Date (date)
  • Time (time)
  • Date time (date and time )
  • Text (alphanumeric string of up to 2GB of data)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how to write select all in SQL?

A

SELECT *

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

how to choose a specific table in SQL?

A

FROM specific table

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

how to select a particular field of a record (one box) in SQL?

A

WHERE fieldname = data in particular field

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

what are the two ways you can order data in SQL?

A

ascending (ORDER BY ASC)
descending (ORDER BY DESC)

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

Be able to use SQL to insert data into a relational database using the commands.

INSERT INTO table_name (column1, column 2 …)
VALUES (value1, value2 …)

A

can you do that?

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

Be able to use SQL to edit and delete data in a database using the commands.

UPDATE table_name
SET column1 = value1, column2
= value2 …
WHERE condition
DELETE FROM table_name WHERE condition

A

can you do that?

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