8. Database Fundamentals Flashcards
Database = ___ + ___ + _____
Data; Database Management System (DBMS); Associated applications
Database advantages over files (4)
Multiple concurrent users; scalability; speed (SQL); variety of data elements
each table contains
information about a single subject or topic (customers, products, etc)
each column (field) contains
information about a single characteristic of the table subject (name, address, etc)
each row (record) contains
information about a single instance of the table subject (individual customer, etc)
keys are
special purpose database fields used to define relationships between tables
the purpose of the primary key is to
allow the database to uniquely identify each record in the table (customer ID)
constraints are
business rules that define what values we can enter into a column/field (age range)
the purpose of the foreign key is to
define the relationships between tables
the foreign key is
the primary key in another table
2 major sub languages for SQL
Data Definition Language (DDL) and Data Manipulation Language (DML)
DDL ____
Defines/modifies the structure of the database
4 commands for DDL
CREATE; ALTER; DROP, Permissions
DML _____
Modifies the contents of a database
4 commands for DML
SELECT; INSERT; DELETE; UPDATE
CREATE -
(DDL) new table within a database or new database on a server
ALTER -
(DDL) modifies the structure of an existing database table
DROP -
(DDL) deletes an existing table or database (use with caution!)
SELECT -
(DML) Queries or retrieves information from within a database (most common command)
INSERT -
(DML) adds a new record to a database table
DELETE -
(DML) removes a record from a database table
UPDATE -
(DML) modifies existing records in a database table
2 ways to access a database
Write SQL commands; Programmatic access (software sends SQL commands - user input forms)
Non-relational databases trade
constraints for speed
Key Value Stores are
databases designed for storing/retrieving key-value pairs
Key Value pairs are
a semi-structured way to store data and indexed by a key
Document Stores are
specialized databases designed to store large documents, like JSON and XML files (indexed with a key)