1. Home
  2. Explore
  3. Computer Science
  4. SQL Database Course

Study methods

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

SQL Database Course

  • 63Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Database Fundamentals
A database is defined as any collection of
information.

63 questions

  1. 1
    A database is defined as any collection of
    _____
    information.
    Hint

    Think about what kind of information is typically grouped together in a database.

    Answer

    related

  2. 2
    A
    _____
    is software that helps users create and maintain a database on a computer.
    Hint

    Abbreviated as DBMS, this software handles CRUD operations and security.

    Answer

    database management system

  3. 3
    The acronym CRUD stands for Create, Read, Update, and
    _____
    .
    Hint

    The fourth operation removes data from the database.

    Answer

    Delete

  4. 4
    A relational database organizes data into one or more
    _____
    with columns and rows.
    Hint

    This structure is similar to a spreadsheet.

    Answer

    tables

  5. 5
    SQL stands for Structured
    _____
    Language.
    Hint

    The 'Q' in SQL indicates it is used to ask questions of a database.

    Answer

    Query

  6. 6
    A
    _____
    is a request made to the database management system for specific information.
    Hint

    Think of it like a Google search but for databases.

    Answer

    query

  7. 7
    Non-relational databases are also known as
    _____
    databases.
    Hint

    This term contrasts with SQL databases.

    Answer

    NoSQL

  8. 8
    In a relational database table, a
    _____
    uniquely identifies each row.
    Hint

    This key must be unique and not null for every record.

    Answer

    primary key

  9. 9
    A
    _____
    key has no mapping to anything in the real world, such as an auto-incremented employee ID.
    Hint

    This type of key is system-generated and has no intrinsic meaning outside the database.

    Answer

    surrogate

  10. 10
    A
    _____
    key is a primary key that has a real-world mapping, such as a Social Security Number.
    Hint

    This key exists in the real world and is used for identification outside the database.

    Answer

    natural

  11. 11
    A
    _____
    key is an attribute that stores the primary key of a row in another table, creating a relationship.
    Hint

    It links two tables together.

    Answer

    foreign

  12. 12
    When a primary key consists of two or more columns, it is called a
    _____
    key.
    Hint

    Also known as a compound key.

    Answer

    composite

  13. 13
    A column that defines a single attribute of a table is called a
    _____
    .
    Hint

    Vertical sections in a table.

    Answer

    column

  14. 14
    A horizontal entry in a table is called a
    _____
    .
    Hint

    Also known as a record.

    Answer

    row

  15. 15
    The SQL keyword
    _____
    is used to retrieve data from a database.
    Hint

    This is the most common SQL command.

    Answer

    SELECT

  16. 16
    SQL is a hybrid language that includes DDL, DML, DCL, and
    _____
    .
    Hint

    DQL stands for Data Query Language, used for querying data.

    Answer

    DQL

  17. 17
    MySQL is an example of a relational
    _____
    management system.
    Hint

    RDBMS stands for Relational Database Management System.

    Answer

    database

  18. 18
    The default port for MySQL is
    _____
    .
    Hint

    This port number is standard for MySQL connections.

    Answer

    3306

  19. 19
    To create a new database in MySQL, use the command: CREATE DATABASE
    _____
    ;
    Hint

    Replace this with the actual name you want to give your database.

    Answer

    database_name

  20. 20
    The DESCRIBE command is used to display the structure of a
    _____
    .
    Hint

    It shows column names, data types, and constraints.

    Answer

    table

  21. 21
    To delete a table entirely, use the
    _____
    TABLE command.
    Hint

    This command removes both the table structure and its data permanently.

    Answer

    DROP

  22. 22
    The data type
    _____
    is used to store a fixed-length string of characters.
    Hint

    Variable character field; specify maximum length in parentheses.

    Answer

    VARCHAR

  23. 23
    The data type
    _____
    is used to store decimal numbers with specified precision.
    Hint

    Often used for monetary values where exact precision is needed.

    Answer

    DECIMAL

  24. 24
    The data type
    _____
    is used to store large binary objects like images or files.
    Hint

    Binary Large Object.

    Answer

    BLOB

  25. 25
    To insert a new row into a table, use the
    _____
    INTO statement.
    Hint

    This statement adds new records to a table.

    Answer

    INSERT

  26. 26
    When inserting data, if a column is omitted, it will store the value
    _____
    unless a default is set.
    Hint

    This represents the absence of a value.

    Answer

    NULL

  27. 27
    A constraint that ensures a column cannot store NULL values is called
    _____
    .
    Hint

    This constraint enforces that every row must have a value for that column.

    Answer

    NOT NULL

  28. 28
    A constraint that ensures all values in a column are different is called
    _____
    .
    Hint

    This prevents duplicate entries in that column.

    Answer

    UNIQUE

  29. 29
    To automatically generate sequential numbers for a primary key, use the
    _____
    attribute.
    Hint

    Commonly used with integer primary keys to avoid manual entry.

    Answer

    AUTO_INCREMENT

  30. 30
    To set a default value for a column, use the
    _____
    keyword in the column definition.
    Hint

    This provides a fallback value when no value is specified.

    Answer

    DEFAULT

  31. 31
    The UPDATE statement is used to modify
    _____
    rows in a table.
    Hint

    It changes data already stored in the table.

    Answer

    existing

  32. 32
    In an UPDATE statement, the WHERE clause specifies which
    _____
    to modify.
    Hint

    Without WHERE, all rows are affected.

    Answer

    rows

  33. 33
    To remove rows from a table, use the
    _____
    FROM statement.
    Hint

    This statement deletes one or more rows based on a condition.

    Answer

    DELETE

  34. 34
    In a SELECT statement, the asterisk (*) means select all
    _____
    .
    Hint

    It returns every column from the table.

    Answer

    columns

  35. 35
    To sort the result set, use the
    _____
    BY clause.
    Hint

    This clause arranges rows in ascending or descending order.

    Answer

    ORDER

  36. 36
    To return only a specific number of rows from a query, use the
    _____
    clause.
    Hint

    This is useful for pagination or testing.

    Answer

    LIMIT

  37. 37
    The
    _____
    keyword is used with WHERE to match values against a list of values.
    Hint

    It is a shorthand for multiple OR conditions.

    Answer

    IN

  38. 38
    To retrieve unique values from a column, use the
    _____
    keyword.
    Hint

    It eliminates duplicate rows from the result.

    Answer

    DISTINCT

  39. 39
    The
    _____
    function returns the number of rows in a result set.
    Hint

    It can be used with * or a specific column.

    Answer

    COUNT

  40. 40
    To calculate the average of a numeric column, use the
    _____
    function.
    Hint

    This function returns the mean value.

    Answer

    AVG

  41. 41
    To calculate the total sum of a numeric column, use the
    _____
    function.
    Hint

    This function adds up all values.

    Answer

    SUM

  42. 42
    The
    _____
    clause is used with aggregate functions to group rows that have the same values in specified columns.
    Hint

    It divides the result set into groups of rows.

    Answer

    GROUP BY

  43. 43
    In SQL, the
    _____
    keyword is used for pattern matching with wildcards.
    Hint

    It is used in WHERE clauses to search for a pattern.

    Answer

    LIKE

  44. 44
    The wildcard character
    _____
    matches any single character in a LIKE pattern.
    Hint

    It represents exactly one unspecified character.

    Answer

    _

  45. 45
    The wildcard character % matches any sequence of
    _____
    characters in a LIKE pattern.
    Hint

    It can match 0 or more characters.

    Answer

    zero or more

  46. 46
    The UNION operator combines the result sets of two or more
    _____
    statements.
    Hint

    All queries must have the same number of columns.

    Answer

    SELECT

  47. 47
    A JOIN that returns only rows with matching values in both tables is called an
    _____
    JOIN.
    Hint

    Also known as a simple JOIN.

    Answer

    INNER

  48. 48
    A LEFT JOIN returns all rows from the
    _____
    table and matching rows from the right table.
    Hint

    Non-matching rows from the right table have NULL values.

    Answer

    left

  49. 49
    A RIGHT JOIN returns all rows from the
    _____
    table and matching rows from the left table.
    Hint

    Opposite of LEFT JOIN.

    Answer

    right

  50. 50
    A subquery is a query nested inside another query, often used with the
    _____
    keyword or equality operators.
    Hint

    It allows you to use the result of one query as a condition in another.

    Answer

    IN

  51. 51
    In MySQL, ON DELETE
    _____
    sets the foreign key column to NULL when the referenced row is deleted.
    Hint

    Alternative to CASCADE for non-primary key foreign keys.

    Answer

    SET NULL

  52. 52
    In MySQL, ON DELETE
    _____
    deletes the row in the child table when the referenced row in the parent table is deleted.
    Hint

    Used when the foreign key is part of the primary key or when you want the child row to be deleted automatically.

    Answer

    CASCADE

  53. 53
    A
    _____
    is a block of SQL code that automatically executes in response to certain events on a table, such as INSERT, UPDATE, or DELETE.
    Hint

    It can be set to run BEFORE or AFTER the event.

    Answer

    trigger

  54. 54
    In a trigger, the keyword
    _____
    refers to the new row being inserted or updated.
    Hint

    It allows access to column values of the new row.

    Answer

    NEW

  55. 55
    In an ER diagram, an entity is represented by a
    _____
    shape.
    Hint

    It is a basic building block of the diagram.

    Answer

    rectangle

  56. 56
    An attribute that can be broken down into smaller sub-attributes is called a
    _____
    attribute.
    Hint

    For example, a name attribute can be split into first name and last name.

    Answer

    composite

  57. 57
    A
    _____
    attribute can have multiple values for a single entity instance.
    Hint

    Represented by a double oval in ER diagrams.

    Answer

    multi-valued

  58. 58
    A
    _____
    attribute is one whose value can be derived from other attributes, so it does not need to be stored.
    Hint

    Represented by a dashed oval in ER diagrams.

    Answer

    derived

  59. 59
    In an ER diagram, a relationship is represented by a
    _____
    shape.
    Hint

    It connects entities and is labeled with a verb.

    Answer

    diamond

  60. 60
    In a binary relationship,
    _____
    participation means every instance of the entity must participate in the relationship, represented by a double line.
    Hint

    Opposite of partial participation.

    Answer

    total

  61. 61
    A weak entity is represented by a
    _____
    rectangle in an ER diagram.
    Hint

    It depends on a strong entity for its existence.

    Answer

    double

  62. 62
    When converting a 1:N binary relationship to a relational schema, the primary key of the
    _____
    side is added as a foreign key in the N-side table.
    Hint

    The side with cardinality '1' provides the foreign key.

    Answer

    1

  63. 63
    When converting an M:N binary relationship to a relational schema, a new
    _____
    is created with a composite primary key consisting of the foreign keys from both entities.
    Hint

    This new table also includes any attributes of the relationship.

    Answer

    table

1 of 63
Question 1 of 63

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent