Databases

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/24

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.

25 Terms

1
New cards

What is a database?

A database is an organized collection of related data

2
New cards

What is a table in a database?

A table is a database object used to store records in a field in the form of columns and rows that holds data.

3
New cards

What is a record in a database?

A record (also called a row of data) is an ordered set of related data in a table.

4
New cards

What is a field in a database?

A field is an area within a record reserved for a specific piece of data. Examples: Employee Name, Employee ID, etc.

5
New cards

What is a data type?

Data type is the type of information the data is e.g. integer, date/time

6
New cards

What is a primary key?

A primary key is a field (or group of fields) that uniquely identifies a given entity in a table

7
New cards

What are the two types of databases?

Types of databases: ★ Flat-file ★ Relational

8
New cards

What is a flat-file database?

A flat-file database is a database in which all the data is stored in a single table

9
New cards

What is an advantage of a flat-file database?

Advantages of a flat-file database: ★ Simple to set up ★ Simple to understand

10
New cards

What is a foreign key?

A foreign key is: ★ A field that references the primary key of another table ✔︎ This creates a link between two tables

11
New cards

What is a relational database?

Relational databases are databases that: ★ Are made up of multiple tables ★ Made up of foreign keys and primary keys

12
New cards

Does a foreign key have to be unique?

No, a foreign key does not have to be unique

13
New cards

What are the advantages of relational databases?

Advantages of relational databases: ★ Data is only stored in one place and then referenced ➜ We input, update or delete a piece of data all in one place 𐬽 Prevents inconsistencies ★ Storing each piece of data once saves storage space ★ More secure — we can make some tables confidential so that only some users can access specific data ★ Data Independence - data can be changed without affecting the program you use to access it

14
New cards

What is the structure of an SQL query?

SELECT [fields are separated by commas e.g. name,gender]
FROM
15
New cards

How do you select everything from a table?

To select everything from a table, you can say: SELECT *

16
New cards

What does >= mean in SQL queries?

★ >= in SQL queries means (greater than or equal to) ★ Similar is true with <=

17
New cards

What two Boolean operators could we use to make WHERE searches more specific?

★ We can use the Boolean operators 'AND' and 'OR' to make WHERE searches more specific ★ e.g. WHERE rating >= 4 AND price_per_day <= 100

18
New cards

What does != mean in SQL queries?

!= means not equal to in SQL queries

19
New cards

How do you deal with string in SQL?

In SQL, you deal with string with "string"

20
New cards

How can you add complete records in tables?

INSERT INTO
VALUES(
21
New cards

How can you add incomplete records in tables?

INSERT INTO ()
VALUES(
22
New cards

How do you update values in a database?

UPDATE
SET = value, = other_value [etc.]
WHERE =
23
New cards

How do you delete values in a database?

DELETE
FROM
WHERE = condition [e.g. rating = 2.3, ID =7]
24
New cards

How do you reference field names in a relational database

In. Relational databases, you reference fields by saying:
.field [e.g. orders.drinks]
25
New cards

What line has to be added at the WHERE of relational databases?

Line has to be added to relational databases WHERE:
.primary_key1. = .primary_key2