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/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

Database

A structured way of storing data so it can be retrieved using queries

2
New cards

Table

A collection of related data

3
New cards

Record

A collection of fields about the same person, thing, item or object in a database

4
New cards

Field

A collection of fields about the same person, thing, item or object in a database

5
New cards

Primary Key

A field that stores unique data for each record in a table. These are normally an ID Number

6
New cards

Foreign Key

A field in a table that references a primary key of
another table

7
New cards

Database Data Types

knowt flashcard image
8
New cards

Flat File Database

A single table of data stored inside a single text file. These are often stored using A CSV format

9
New cards

Relational Database

A database that contains multiple tables that are linked together. They allow us to design tables that reduce inconsistencies and eliminate data redundancy.

10
New cards

Relationship

A link between 2 tables. There are 3 types of relationships:

<p>A link between 2 tables. There are 3 types of relationships:</p>
11
New cards

SQL (Structured Query Language)

A language that allows you to create, query, update and delete data to and from databases

12
New cards

Writing a Query SQL

SELECT (The fields that you want to be displayed)

FROM (The table name)

WHERE (The search criteria)

SELECT Field1, Field2, Field3
FROM Table1
WHERE x=y

13
New cards

Database Reference (Customer)

knowt flashcard image
14
New cards

The SELECT Statement (Quering Data)

Allows you to select the records from a table using the fields of the table. You can either type all the fields that you require or use a wildcard

Example:

SELECT Name, Address,PhoneNo

FROM customer

15
New cards

Wildcard

Allows you to select all the columns of data

Example:

SELECT *

FROM customer

16
New cards

The WHERE Clause

Allows you to select only records satisfying a specified condition

Example:

SELECT Name, PhoneNo

FROM customer

WHERE age = 42

17
New cards

WHERE Clause Operators

knowt flashcard image
18
New cards

ORDER BY Statement

Allows you to sort a query into ascending (ASC) or descending(DESC) order

Example:

SELECT *

FROM customer

ORDER BY Name ASC

19
New cards

The INSERT Statement (Inserting Data in A Table)

Allows you to enter a record into a table

Example:

INSERT INTO customer (CustID, Name, Address, PhoneNo, Age)

VALUES (1006, “Geoffrey”, “Manchester”, 782104, 63)

20
New cards

The UPDATE Statement (Updating Data in A Table)

Allows you to update a record (or records) in a table

Example:

UPDATE customer

SET Name = “Simon”

WHERE CustomerID = 5

21
New cards

The DELETE Statement (Deleting Data in A Table)

Allows you to delete a record (or records) from a table

Example:

DELETE FROM customer

WHERE name = “Simon”