databases T7 Flashcards
uses of databases
used in business situations and back-end of many cloud services
examples of uses of databases
management information systems
customer and retail
websites
games
social media
define database
a structured way to store data so that it can be retrieved using queries
define a field
a single item of data in a column within a database
define a record
a collection of fields, a basic data structure
varchar
a variable length string
varchar
a variable length string
flat file database
a database with one table
primary key
a field that is unique for every record
relational database
database with multiple tables which are linked through their key fields
foreign key
a field in one table that is a primary key in another
why use relational databases
flat file databases can have a lot of redundant data so relational databases reduce inconsistencies and redundant data
redundant data
repetitions of the same data
inconsistent data
writing data in different formats
sql
structured query language
define query
a question asked about a database
SELECT (field) query
this retrieves data from the database (used for searching)
FROM (table)
stating which table you are retrieving data from
WHERE (condition)
stating what condition you want the data to meet/how it is filtered
ORDER BY (field) ASC/DESC
stating how you want the field ordered
how to join data from two related tables
you need to match the foreign key to the primary key using WHERE
INSERT INTO (table(fields)
VALUE (values)
adds a record to the table