Flashcards › Technology & Coding › Databases

SQL Commands

Core SQL statements and database terms for querying and changing data.

72 cardsGrades 9–12, College, Adult#SQL#database#queries

0 of 72 known
72 cards
  • SQLCommand or term
    Structured Query Language, used to work with databases
  • DatabaseCommand or term
    An organized collection of data
  • TableCommand or term
    Rows and columns of data in a database
  • Row (record)Command or term
    One entry in a table
  • Column (field)Command or term
    One attribute shared by all rows
  • Primary keyCommand or term
    A column that uniquely identifies each row
  • Foreign keyCommand or term
    A column linking to the primary key of another table
  • SELECTCommand or term
    Gets data from a table
  • SELECT *Command or term
    Gets every column
  • FROMCommand or term
    Names the table to read
  • WHERECommand or term
    Filters rows by a condition
  • AND, OR, NOTCommand or term
    Combine or negate conditions
  • ORDER BYCommand or term
    Sorts the results
  • ASC / DESCCommand or term
    Sort ascending or descending
  • LIMITCommand or term
    Restricts how many rows are returned
  • DISTINCTCommand or term
    Removes duplicate values from results
  • LIKECommand or term
    Matches text patterns
  • % wildcardCommand or term
    Matches any number of characters in LIKE
  • _ wildcardCommand or term
    Matches exactly one character in LIKE
  • INCommand or term
    Matches any value in a list
  • BETWEENCommand or term
    Matches a range of values
  • IS NULLCommand or term
    Tests for missing values
  • AS (alias)Command or term
    Gives a column or table a temporary name
  • INSERT INTOCommand or term
    Adds new rows to a table
  • VALUESCommand or term
    Gives the values for an insert
  • UPDATECommand or term
    Changes data in existing rows
  • SETCommand or term
    Names the columns to change in an update
  • DELETE FROMCommand or term
    Removes rows
  • CREATE TABLECommand or term
    Makes a new table
  • ALTER TABLECommand or term
    Changes a table's structure
  • DROP TABLECommand or term
    Deletes a table entirely
  • CREATE INDEXCommand or term
    Makes a table lookup faster
  • COUNT()Command or term
    Counts rows
  • SUM()Command or term
    Adds up values
  • AVG()Command or term
    Finds the average
  • MIN()Command or term
    Finds the smallest value
  • MAX()Command or term
    Finds the largest value
  • GROUP BYCommand or term
    Groups rows to use with aggregate functions
  • HAVINGCommand or term
    Filters groups after grouping
  • JOINCommand or term
    Combines rows from two tables
  • INNER JOINCommand or term
    Keeps only rows that match in both tables
  • LEFT JOINCommand or term
    Keeps all rows from the left table and matches from the right
  • RIGHT JOINCommand or term
    Keeps all rows from the right table and matches from the left
  • FULL OUTER JOINCommand or term
    Keeps all rows from both tables
  • CROSS JOINCommand or term
    Pairs every row of one table with every row of another
  • UNIONCommand or term
    Combines results of two queries, removing duplicates
  • UNION ALLCommand or term
    Combines results and keeps duplicates
  • SubqueryCommand or term
    A query inside another query
  • EXISTSCommand or term
    Tests whether a subquery returns rows
  • CASE WHENCommand or term
    Conditional logic inside a query
  • NULLCommand or term
    A missing or unknown value
  • NOT NULLCommand or term
    A column must always have a value
  • UNIQUECommand or term
    All values in a column must be different
  • DEFAULTCommand or term
    A value used when none is given
  • CHECKCommand or term
    A rule that values must satisfy
  • TransactionCommand or term
    A group of operations that succeed or fail together
  • COMMITCommand or term
    Saves a transaction
  • ROLLBACKCommand or term
    Undoes a transaction
  • ViewCommand or term
    A saved query that acts like a table
  • IndexCommand or term
    A structure that speeds up searches
  • NormalizationCommand or term
    Organizing tables to reduce repeated data
  • SchemaCommand or term
    The structure of a database
  • Relational databaseCommand or term
    A database storing data in related tables
  • One-to-many relationshipCommand or term
    One row in a table relates to many rows in another
  • Many-to-many relationshipCommand or term
    Many rows relate to many, using a join table
  • ACIDCommand or term
    Atomicity, Consistency, Isolation, Durability, properties of reliable transactions
  • SQL injectionCommand or term
    An attack that sneaks harmful SQL into input; prevent with parameterized queries
  • Parameterized queryCommand or term
    A query with placeholders for safe user input
  • MySQL, PostgreSQL, SQLiteCommand or term
    Popular SQL database systems
  • NoSQLCommand or term
    Databases that don't use traditional tables, like document stores
  • QueryCommand or term
    A request for data
  • CRUDCommand or term
    Create, Read, Update, Delete

Download this deck

Want paper cards? Paste the plain-text download into the flashcard maker.