Relational Databases and Structured Query Language (SQL)

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/17

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards
What is a database?
Information stored in a structured/organised way so it can be easily accessed, searched, managed and updated
2
New cards
What is a relational database?
Where data is stored in multiple linked tables
3
New cards
What is a table?
A collection of records about the same topic
4
New cards
What is a record?
A collection of fields about the same item
5
New cards
What is a field?
The smallest unit of storage in a database, needed for every different piece of information you wish to store
6
New cards
What is a data type?
The attribute that specifies the type of data that a field can hold
7
New cards
What is a primary key?
A record’s unique identifier
8
New cards
What is a foreign key?
A field that stores a reference to the primary key from another table
9
New cards
Why use a relational database?
To eliminate data inconsistency and data redundancy
10
New cards
How do you find information within a database?
```sql
SELECT column_name(s)
```
11
New cards
How do you select the table(s) that contain(s) the information in the database?
```sql
FROM table_name
```
12
New cards
How do you select the criteria you need to find the information in the database?
```sql
WHERE condition
```
13
New cards
How do you sort the data in ascending order when it is retrieved?
```sql
ORDER BY column_name(s) ASC
```
14
New cards
How do you sort the data in descending order when it is retrieved?
```sql
ORDER BY column_name(s) DESC
```
15
New cards
How do you insert data into a relational database?
```sql
INSERT INTO table_name (column1, column 2 …)
VALUES (value1, value2 …)
```
16
New cards
How do you edit data in a database?
```sql
UPDATE table_name
SET column1 = value1, column2 = value2 ...
WHERE condition
```
17
New cards
How do you delete data in a database?
```sql
DELETE FROM table_name WHERE condition
```
18
New cards
How do you do cross-table queries?
```sql
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
```