CH15: Databases and SQL Flashcards
____ the database in the MySQL file tree to set the model as the default option for SQL commands
double click
PRIMARY KEY
unique identifier in the table
How does AUTO_INCREMENT affect a new entry to a table?
assigns every new entry a different integer value
What does the following SQL cmd accomplish?
INSERT INTO seeds (crop, encourages, use_by)
VALUES (“Agastache”, “bees & hummingbirds”, 2020);
Adds new entry to seeds table in listed columns
___ is stored in a column when a value for a field is not supplied
null
If you leave out the ____ clause in a SQL UPDATE or DELETE FROM command, ALL records in a table are updated/deleted
WHERE
SELECT * FROM example_table
Select all entries in a table
Use the ___ to import csv files into a table
Table Data Import Wizard
Define persistent data source
Data that is stored after process that created it has ended. It is written to non-volatile storage
What does ACID stand for in database transactions?
Atomicity
Isolation
Consistency
Durability
Define atomicity
transaction treated as single unit
Define consistency
transaction can only bring the database from one valid state to another
Define Isolation
Transactions often execute concurrently (multiple reading and writing to table). Isolation ensures this execution leave DB in same state as sequential execution
Define Durability
Guarantees once transaction committed, stays that way, even in the event of system failure
Define Relational Database
collection of data items with pre-defined relationships between them
What is a RDMS, name one example
A tool used to interact with data stored in a table. SQL is a common example
True/False: STRING is a SQL data type
False, VARCHAR handles strings in SQL
What is the data type for handling integers in SQL?
INT (also DOUBLE, BIGINT, MEDIUMINT)
Which SQL datatype are BOOL and BOOLEAN synonymous with?
TINYINT (0 = false, 1 = true)
What is CRUD?
Create
Read
Update
Delete
These are the 4 major operations performed when working with data.
How would you scaffold an update to a table?
UPDATE
SET
WHERE
How would you scaffold adding a column to a table?
ALTER TABLE
ADD
How would you scaffold creating a table from another table?
CREATE TABLE
AS SELECT
FROM
WHERE
How would you scaffold deleting an entry from a table?
DELETE FROM
WHERE