1. Home
  2. Explore
  3. Computer Science
  4. SQL Fundamentals

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

SQL Fundamentals

  • 119Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: SQL Foundations
SQL stands for
.

119 questions

  1. 1
    SQL stands for
    _____
    .
    Hint

    Think of the full name of the language used to communicate with databases.

    Answer

    structured query language

  2. 2
    SQL is primarily used to communicate with
    _____
    .
    Hint

    It is the query language used to get data in and out of database servers.

    Answer

    databases

  3. 3
    A database is software that makes it easier to store large amounts of data in a computer's
    _____
    .
    Hint

    Think about where files are stored on a computer.

    Answer

    file system

  4. 4
    A database can be compared conceptually to an advanced version of Microsoft Excel or
    _____
    .
    Hint

    It is another spreadsheet application mentioned in the lesson.

    Answer

    Google Sheets

  5. 5
    SQL automates database creates, reads, updates, and deletes, commonly abbreviated as
    _____
    .
    Hint

    The abbreviation consists of the first letters of the four operations.

    Answer

    CRUD

  6. 6
    A SQL read operation is generally performed with a
    _____
    statement.
    Hint

    This statement retrieves data from a table.

    Answer

    SELECT

  7. 7
    The result of a SQL SELECT statement is typically a result set organized as rows and
    _____
    .
    Hint

    Think of the structure of a table.

    Answer

    columns

  8. 8
    SQL statements conventionally end with a
    _____
    .
    Hint

    It is the punctuation mark used to terminate SQL statements.

    Answer

    semicolon

  9. 9
    SQL keywords are generally
    _____
    insensitive.
    Hint

    SELECT and select are treated equivalently.

    Answer

    case

  10. 10
    PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and CockroachDB are examples of
    _____
    databases.
    Hint

    They all support structured query language.

    Answer

    SQL

  11. 11
    In a SELECT statement, the
    _____
    operator retrieves every column from a table.
    Hint

    It is also called the wildcard operator.

    Answer

    star

  12. 12
    To select multiple columns in SQL, separate their names with a
    _____
    .
    Hint

    The same punctuation separates items in many lists.

    Answer

    comma

  13. 13
    The clause that identifies the table from which SELECT retrieves data is
    _____
    .
    Hint

    It appears after the selected columns.

    Answer

    FROM

  14. 14
    The clause used to filter rows before returning them is
    _____
    .
    Hint

    It introduces a condition that rows must satisfy.

    Answer

    WHERE

  15. 15
    In SQL, equality is tested with a
    _____
    equals sign rather than a double equals sign.
    Hint

    SQL uses a simpler equality operator than many programming languages.

    Answer

    single

  16. 16
    The SQL condition used to test whether a value falls within two inclusive boundaries is
    _____
    .
    Hint

    It is useful for filtering ages or prices within a range.

    Answer

    BETWEEN

  17. 17
    To reverse a BETWEEN condition and select values outside a range, place
    _____
    before BETWEEN.
    Hint

    This keyword negates the condition.

    Answer

    NOT

  18. 18
    The
    _____
    keyword returns only unique values from a result set.
    Hint

    It prevents repeated values from appearing in the output.

    Answer

    DISTINCT

  19. 19
    The
    _____
    clause sorts rows by one or more columns.
    Hint

    It is commonly combined with ascending or descending order.

    Answer

    ORDER BY

  20. 20
    SQL sorts values from smallest to largest by default, which is called
    _____
    order.
    Hint

    The opposite is descending order.

    Answer

    ascending

  21. 21
    The SQL keyword that restricts the maximum number of returned rows is
    _____
    .
    Hint

    It is useful when a table contains millions of records.

    Answer

    LIMIT

  22. 22
    The
    _____
    operator performs fuzzy or wildcard matching against text.
    Hint

    It can find names that start with or contain a particular string.

    Answer

    LIKE

  23. 23
    In a LIKE pattern, the percent sign matches
    _____
    or more characters.
    Hint

    The pattern can match no additional characters or many additional characters.

    Answer

    zero

  24. 24
    In a LIKE pattern, the underscore wildcard matches exactly
    _____
    character.
    Hint

    It differs from the percent wildcard by matching a single position.

    Answer

    one

  25. 25
    To find names beginning with the letters Al, a LIKE pattern should place a percent wildcard
    _____
    the text Al.
    Hint

    The wildcard represents the remaining characters.

    Answer

    after

  26. 26
    The logical operator that requires both conditions to be true is
    _____
    .
    Hint

    It narrows results by requiring multiple conditions simultaneously.

    Answer

    AND

  27. 27
    The logical operator that requires at least one condition to be true is
    _____
    .
    Hint

    It provides an alternative between conditions.

    Answer

    OR

  28. 28
    Parentheses in SQL conditions are used to control the order of
    _____
    .
    Hint

    They determine which logical expression is evaluated first.

    Answer

    operations

  29. 29
    The SQL syntax used to test whether a value is missing is
    _____
    .
    Hint

    It is not written as an equality comparison with NULL.

    Answer

    IS NULL

  30. 30
    The SQL syntax used to exclude rows containing missing values is
    _____
    .
    Hint

    It is the opposite of IS NULL.

    Answer

    IS NOT NULL

  31. 31
    A SQL NULL value indicates the
    _____
    of a value.
    Hint

    It is different from an empty string, zero, or false.

    Answer

    absence

  32. 32
    The SQL statement used to add new rows to a table is
    _____
    .
    Hint

    It is one of the four CRUD operations.

    Answer

    INSERT

  33. 33
    The SQL statement used to modify existing rows is
    _____
    .
    Hint

    It changes values already stored in a table.

    Answer

    UPDATE

  34. 34
    The SQL statement used to remove rows is
    _____
    .
    Hint

    It corresponds to the final operation in CRUD.

    Answer

    DELETE

  35. 35
    An UPDATE statement uses the
    _____
    keyword to specify replacement column values.
    Hint

    It appears between the table name and the new values.

    Answer

    SET

  36. 36
    A DELETE statement without a WHERE clause can remove
    _____
    rows in a table.
    Hint

    The absence of a filter means every record qualifies.

    Answer

    all

  37. 37
    A safe way to verify which records a DELETE will affect is to run the same condition as a
    _____
    statement first.
    Hint

    This lets you inspect the rows before removing them.

    Answer

    SELECT

  38. 38
    When deleting one known record, filtering by its
    _____
    is generally safer than filtering by a common name.
    Hint

    This value uniquely identifies the row.

    Answer

    primary key

  39. 39
    The SQL keyword that automatically generates successive integer identifiers in supported databases is
    _____
    .
    Hint

    It avoids manually selecting the next available ID.

    Answer

    AUTOINCREMENT

  40. 40
    A randomly generated identifier with an extremely low chance of duplication is called a
    _____
    .
    Hint

    It is an alternative to sequential integer IDs.

    Answer

    UUID

  41. 41
    The HTTP method that commonly maps to a CRUD create operation is
    _____
    .
    Hint

    It is commonly used when submitting new data to a server.

    Answer

    POST

  42. 42
    The HTTP method that commonly maps to a CRUD read operation is
    _____
    .
    Hint

    It is conventionally used to retrieve data.

    Answer

    GET

  43. 43
    The HTTP method that commonly maps to a CRUD update operation is
    _____
    .
    Hint

    It is used to replace or update a resource.

    Answer

    PUT

  44. 44
    In a typical web application, the front end communicates with the backend using
    _____
    .
    Hint

    It is the protocol used for web requests and responses.

    Answer

    HTTP

  45. 45
    In a typical web application, the backend communicates with the database using
    _____
    .
    Hint

    This is the database query language discussed throughout the course.

    Answer

    SQL

  46. 46
    A successful database operation commonly results in an HTTP 200
    _____
    response.
    Hint

    This is the standard phrase associated with status code 200.

    Answer

    OK

  47. 47
    An object relational mapping library maps programming-language objects or structs to database
    _____
    .
    Hint

    It connects in-memory data structures to relational database structures.

    Answer

    tables

  48. 48
    An ORM generally trades simplicity for
    _____
    .
    Hint

    Raw SQL provides more direct control over database behavior.

    Answer

    control

  49. 49
    An ORM can make application code less
    _____
    by generating common SQL operations.
    Hint

    It reduces the amount of code developers must write.

    Answer

    verbose

  50. 50
    A database migration is an incremental change made to a database
    _____
    .
    Hint

    It changes tables, columns, or their structure.

    Answer

    schema

  51. 51
    Adding a new table or column is generally a relatively
    _____
    migration.
    Hint

    Existing application code usually does not depend on something that did not exist.

    Answer

    safe

  52. 52
    Removing a table or column is generally a
    _____
    migration.
    Hint

    Existing code may still query the removed resource.

    Answer

    dangerous

  53. 53
    Before deleting a column or table, developers should first update the application
    _____
    to stop using it.
    Hint

    The application must no longer query the resource being removed.

    Answer

    code

  54. 54
    When adding a column or table, developers can generally update the database before updating the application
    _____
    .
    Hint

    The new resource can exist without being used immediately.

    Answer

    code

  55. 55
    A migration that moves the database forward in time is called an
    _____
    migration.
    Hint

    Its counterpart is used to roll changes back.

    Answer

    up

  56. 56
    A migration used to reverse or roll back a change is called a
    _____
    migration.
    Hint

    It is the opposite of an up migration.

    Answer

    down

  57. 57
    The SQL statement used to rename tables or add and remove columns is
    _____
    .
    Hint

    It modifies an existing table definition.

    Answer

    ALTER TABLE

  58. 58
    The SQLite data type used for whole numbers, including negative values, is
    _____
    .
    Hint

    It represents signed whole numbers.

    Answer

    integer

  59. 59
    The SQLite data type used for numbers with fractional parts is
    _____
    .
    Hint

    It corresponds broadly to floating-point values.

    Answer

    real

  60. 60
    The SQLite data type used for character data is
    _____
    .
    Hint

    Email addresses and names are commonly stored using this type.

    Answer

    text

  61. 61
    The SQLite data type used for large binary data is
    _____
    .
    Hint

    The name suggests a large collection of binary data.

    Answer

    blob

  62. 62
    A constraint is a rule that enforces something about a database
    _____
    .
    Hint

    It restricts what values or structures are permitted.

    Answer

    schema

  63. 63
    A primary key must be unique and also implicitly enforces a
    _____
    constraint.
    Hint

    Every primary key must have a value.

    Answer

    not null

  64. 64
    A primary key is normally placed on a table's
    _____
    column.
    Hint

    This column identifies each record.

    Answer

    ID

  65. 65
    A UNIQUE constraint prevents duplicate values but can typically allow
    _____
    values.
    Hint

    This differs from the behavior of a primary key.

    Answer

    NULL

  66. 66
    A foreign key references the primary key of
    _____
    table.
    Hint

    It establishes a relationship between two tables.

    Answer

    another

  67. 67
    A foreign key constraint ensures that the referenced record actually
    _____
    in the other table.
    Hint

    It prevents relationships from pointing to missing records.

    Answer

    exists

  68. 68
    A relational database typically represents data in
    _____
    .
    Hint

    Rows and columns are its basic organizational structures.

    Answer

    tables

  69. 69
    Each row or entry in a relational table is called a
    _____
    .
    Hint

    It represents one stored entity or association.

    Answer

    record

  70. 70
    A relationship in which one entity can be associated with zero or many entities of another type is a
    _____
    relationship.
    Hint

    A user may have many transactions.

    Answer

    one to many

  71. 71
    A relationship in which each entity corresponds to exactly one entity of another type is a
    _____
    relationship.
    Hint

    A student and one GPA can illustrate this structure.

    Answer

    one to one

  72. 72
    A relationship in which multiple records on each side can be associated with one another is a
    _____
    relationship.
    Hint

    Users and groups can both have multiple associations.

    Answer

    many to many

  73. 73
    For a one-to-many relationship, the foreign key is usually stored on the table representing the
    _____
    side.
    Hint

    Tweets store the ID of the user who authored them.

    Answer

    many

  74. 74
    A table used to model a many-to-many relationship is called a
    _____
    table.
    Hint

    It sits between the two related entity tables.

    Answer

    joining

  75. 75
    A joining table normally contains only the identifiers of the related
    _____
    .
    Hint

    It should not usually contain descriptive metadata.

    Answer

    entities

  76. 76
    A database designed to reduce duplicated data and improve data integrity is more highly
    _____
    .
    Hint

    This is the goal of database normalization.

    Answer

    normalized

  77. 77
    First normal form requires every row to have a unique
    _____
    .
    Hint

    This prevents completely duplicate rows.

    Answer

    primary key

  78. 78
    First normal form prohibits
    _____
    tables inside cells.
    Hint

    Each cell should contain an atomic value rather than another table.

    Answer

    nested

  79. 79
    Second normal form requires non-key columns to depend on the
    _____
    primary key.
    Hint

    They must not depend on only part of a composite key.

    Answer

    entire

  80. 80
    Third normal form requires non-key columns to depend only on the
    _____
    key.
    Hint

    A non-key column should not depend on another non-key column.

    Answer

    primary

  81. 81
    Boyce-Codd normal form prevents a primary-key column from depending on a column that is not part of the
    _____
    key.
    Hint

    This addresses a special case involving multiple candidate keys.

    Answer

    primary

  82. 82
    The main practical goals of normalization are reducing data redundancy and improving data
    _____
    .
    Hint

    The second goal concerns keeping data correct and consistent.

    Answer

    integrity

  83. 83
    A user's birthday is generally better to store than their current age because the birthday does not become
    _____
    over time.
    Hint

    Age changes as time passes, but the date of birth does not.

    Answer

    out of date

  84. 84
    A database should generally store data in a
    _____
    form rather than only storing precomputed results.
    Hint

    Aggregations can be calculated later from this form.

    Answer

    raw

  85. 85
    A SQL alias temporarily renames a table or column for the duration of a
    _____
    .
    Hint

    The alias is not permanently saved in the database schema.

    Answer

    query

  86. 86
    The SQL keyword used to create an alias is
    _____
    .
    Hint

    It appears between the original name and its temporary name.

    Answer

    AS

  87. 87
    The SQL function that conditionally returns one of two values is
    _____
    .
    Hint

    It behaves similarly to a ternary expression.

    Answer

    IIF

  88. 88
    The aggregation function that counts rows is
    _____
    .
    Hint

    It can be used with a wildcard to count all records.

    Answer

    COUNT

  89. 89
    The aggregation function that adds numeric values is
    _____
    .
    Hint

    It is useful for calculating a user's total transaction amount.

    Answer

    SUM

  90. 90
    The aggregation function that returns the largest value is
    _____
    .
    Hint

    It finds the greatest amount, price, or other value.

    Answer

    MAX

  91. 91
    The aggregation function that returns the smallest value is
    _____
    .
    Hint

    It finds the lowest value in a set.

    Answer

    MIN

  92. 92
    The aggregation function that calculates the mean is
    _____
    .
    Hint

    It returns the average of the selected values.

    Answer

    AVG

  93. 93
    The clause that groups rows so aggregate functions can produce one result per group is
    _____
    .
    Hint

    It can calculate the number of songs per album or balance per user.

    Answer

    GROUP BY

  94. 94
    The clause that filters grouped results after aggregation is
    _____
    .
    Hint

    It is similar to WHERE but operates after GROUP BY.

    Answer

    HAVING

  95. 95
    A subquery allows a query to use the result set of a
    _____
    query.
    Hint

    The inner query appears inside parentheses within another query.

    Answer

    nested

  96. 96
    The SQL clause that checks whether a value matches any item in a list or subquery result is
    _____
    .
    Hint

    It can replace multiple OR conditions.

    Answer

    IN

  97. 97
    An inner join returns rows that have matching records in
    _____
    tables.
    Hint

    It returns only the intersection of the two related sets.

    Answer

    both

  98. 98
    The keyword used to specify the matching relationship in a JOIN is
    _____
    .
    Hint

    It introduces conditions such as matching IDs.

    Answer

    ON

  99. 99
    A left join returns every row from the
    _____
    table, even without a match in the other table.
    Hint

    The table written first in the join is on this side.

    Answer

    left

  100. 100
    A right join can be replaced by reversing the order of the tables and using a
    _____
    join.
    Hint

    The two approaches preserve the same matching logic.

    Answer

    left

  101. 101
    A full join returns every row from
    _____
    tables, whether or not the rows match.
    Hint

    It combines unmatched rows from each side as well as matching rows.

    Answer

    both

  102. 102
    When two joined tables contain columns with the same name, table and column names can be separated with a
    _____
    .
    Hint

    The qualified form looks like table name followed by punctuation and column name.

    Answer

    dot

  103. 103
    Multiple tables can be combined in one query by chaining multiple
    _____
    statements.
    Hint

    Each additional table can be connected with another instance of this operation.

    Answer

    JOIN

  104. 104
    In a financial application, money is often stored as an integer number of the smallest currency
    _____
    .
    Hint

    For dollars, the example uses pennies rather than fractional dollars.

    Answer

    units

  105. 105
    A database index is an in-memory structure that makes queries run more
    _____
    .
    Hint

    Indexes improve lookup performance.

    Answer

    quickly

  106. 106
    SQL databases commonly implement indexes using
    _____
    trees.
    Hint

    This structure supports efficient searches through sorted values.

    Answer

    binary

  107. 107
    An indexed lookup has logarithmic, or log n, rather than
    _____
    time complexity.
    Hint

    Without an index, the database may scan rows one by one.

    Answer

    linear

  108. 108
    A primary key column is typically indexed
    _____
    by the database.
    Hint

    The database needs efficient access to unique identifiers.

    Answer

    automatically

  109. 109
    Indexes improve read lookups but can slow down
    _____
    operations.
    Hint

    The index must be updated when data changes.

    Answer

    write

  110. 110
    Indexes should generally be added to columns that are frequently used for
    _____
    .
    Hint

    A WHERE condition on a commonly searched column is a typical use case.

    Answer

    lookups

  111. 111
    A multi-column index is ordered by its
    _____
    column first.
    Hint

    The order of indexed columns affects which queries benefit most.

    Answer

    first

  112. 112
    Database denormalization intentionally introduces duplicate data to
    _____
    queries.
    Hint

    It is considered when joins or aggregations become too slow.

    Answer

    speed up

  113. 113
    A database backup strategy commonly creates periodic
    _____
    of the production database.
    Hint

    These are copies taken daily or hourly for recovery.

    Answer

    snapshots

  114. 114
    An append-only log records changes without modifying or removing previous
    _____
    .
    Hint

    It preserves the history of creation and deletion events.

    Answer

    entries

  115. 115
    A soft delete marks a record as deleted instead of actually
    _____
    it from the database.
    Hint

    A deleted-at column is often used for this strategy.

    Answer

    removing

  116. 116
    SQL injection occurs when untrusted input is allowed to alter the structure of a SQL
    _____
    .
    Hint

    An attacker may inject an additional statement such as DROP TABLE.

    Answer

    query

  117. 117
    A semicolon in SQL indicates that a statement has been
    _____
    .
    Hint

    An injected semicolon can cause later text to be interpreted as another statement.

    Answer

    terminated

  118. 118
    SQL injection is best prevented by using a database library that safely handles value
    _____
    .
    Hint

    The library should sanitize dynamic values rather than using raw string concatenation.

    Answer

    interpolation

  119. 119
    Developers should avoid inserting dynamic values into SQL using ordinary string
    _____
    .
    Hint

    This practice can allow malicious input to become executable SQL.

    Answer

    concatenation

1 of 119
Question 1 of 119

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent