Databases - Nick

5.0(1)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:37 PM on 10/13/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

27 Terms

1
New cards

Database

An organized collection of information or data that allows for flexibility in organization, displaying, and printing of information.

2
New cards

Purpose of Databases

They take up little room, can be easily edited, and facilitate easier searching and sorting.

3
New cards

Entity

A person, place, thing, or concept about which data can be collected.

Some examples of database tables might be:

  • a customer table

  • an employee

  • a movies table

  • a smartphone table

  • a car table

4
New cards

Attribute

Describes the facts, details, or characteristics of an entity.

5
New cards

Attribute Types

Different categories of data such as Text, Number, Date, Time, and Boolean.

6
New cards

Text Attribute

Stores characters or words, including combinations of text and numbers.

7
New cards

Number Attribute

Can store whole numbers (integers) or numbers with decimal places.

8
New cards

Date Attribute

Stores dates in various formats.

9
New cards

Time Attribute

Stores time of day, typically in 24-hour format.

10
New cards

Boolean Attribute

Stores true/false or yes/no answers.

11
New cards

Attribute Size

Limits applied to restrict the amount of storage space for data entries.

12
New cards

Entity Relationship Diagrams

Visual representations of entities (green), attributes (orange), and relationships (yellow).

entityName.attributeName and criteria = “searchCriteria”.

Example: Dog.dog name and criteria = “Olly”

13
New cards
<p>What is the query for the cost of the walk?</p>

What is the query for the cost of the walk?

walk.cost

14
New cards
<p>What is the query for dog’s gender if his name is Bruno?</p>

What is the query for dog’s gender if his name is Bruno?

Dog.gender and criteria = “Bruno”

15
New cards

One to Many Relationship

A relationship where a row in table A can have many matching rows in table B, but not vice versa.

16
New cards

Flat File Databases

Useful for small amounts of records but prone to data duplication and human error.

17
New cards

Relational Databases

Tables are linked to prevent data duplication, allowing for complex queries and easier data management.

18
New cards

Validation

Ensures data entered is allowable and sensible through various checks (range, restricted choice, length, presence).

19
New cards

Primary Key

A unique identifier for a single record in a database.

20
New cards

Foreign Key

A field in one table that links to the primary key in another table, creating a relationship.

21
New cards
<p>Identify the primary and foreign key</p>

Identify the primary and foreign key

Product No.

22
New cards

Database Query

A request for information from a database, often performed using SQL.

23
New cards

SQL Code

Structured Query Language used to interact with databases, always ending with a semicolon.

24
New cards

SELECT Operation

Queries and retrieves data from one or more tables in a database.

Code Layout:

SELECT attributes (* means all)

FROM table_name

WHERE attribute = criteria

ORDER BY attribute ASC/DESC

Example:

SELECT name, age, house

FROM Pupils

WHERE age < 15

ORDER BY age DESC, house ASC;

This will print out the attributes name, age and house from the pupils table that are less than 15 years old. Results are sorted by the age attribute in descending order and house in ascending order.

25
New cards

INSERT INTO SQL

Command used to insert a new record into a database.

Code Layout:

INSERT INTO table_name

Values (value1, value2, value3, …); [IN ORDER OF ATTRIBUTE]

Example:

INSERT INTO Pupils

VALUES (6, "Jack Lawrie", 18, "Shiel");

26
New cards

UPDATE RECORD

Command used to update existing records in a database.

Code Layout:

UPDATE table_name

SET attribute1 = value1 etc.

WHERE attribute = criteria

Example:

UPDATE Pupils

SET house = “Ben Nevis”

WHERE house = “Nevis”;

27
New cards

DELETE RECORD

Command used to delete a record from a database.

Code Layout:

DELETE_FROM table_name

WHERE attribute = criteria

Example:

DELETE_FROM Pupils

WHERE name = “Bob Jordan”;