Databases

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 24

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

25 Terms

1

What is a database?

A database is an organized collection of related data

New cards
2

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.

New cards
3

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.

New cards
4

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.

New cards
5

What is a data type?

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

New cards
6

What is a primary key?

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

New cards
7

What are the two types of databases?

Types of databases: ★ Flat-file ★ Relational

New cards
8

What is a flat-file database?

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

New cards
9

What is an advantage of a flat-file database?

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

New cards
10

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

New cards
11

What is a relational database?

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

New cards
12

Does a foreign key have to be unique?

No, a foreign key does not have to be unique

New cards
13

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

New cards
14

What is the structure of an SQL query?

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

How do you select everything from a table?

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

New cards
16

What does >= mean in SQL queries?

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

New cards
17

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

New cards
18

What does != mean in SQL queries?

!= means not equal to in SQL queries

New cards
19

How do you deal with string in SQL?

In SQL, you deal with string with "string"

New cards
20

How can you add complete records in tables?

INSERT INTO
VALUES(
New cards
21

How can you add incomplete records in tables?

INSERT INTO ()
VALUES(
New cards
22

How do you update values in a database?

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

How do you delete values in a database?

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

How do you reference field names in a relational database

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

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
New cards
robot