SQL Basics for Beginners
- 70Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
70 questions
- 1Facts about a person or activity that can be analyzed to gain insight are called_____.
Hint
Think of the facts and attributes collected about a person, object, or activity.
Answer
data
Explanation
Data consists of facts about something that describe it and can provide insight into it.
- 2Extracting meaning from data helps people make_____.
Hint
Consider what useful understanding of data can help people do.
Answer
meaningful decisions
Explanation
Analyzing data and extracting meaning from it can help people make informed decisions.
- 3A dedicated storage location for data is a_____.
Hint
Think of the organized storage location used to hold data.
Answer
database
Explanation
A database is a dedicated place for storing data so it can be managed and used.
- 4SQL is a_____used to communicate with a database and work with its data.
Hint
SQL is a language used to ask a database for information and perform actions on it.
Answer
query language
Explanation
SQL is a query language used to communicate with databases and retrieve or manipulate data.
- 5A_____processes an SQL query and can return its results.
Hint
What kind of database system processes queries for relational databases?
Answer
relational database management system
Explanation
An RDBMS processes SQL queries and returns their results.
- 6In a relational table, each row represents a_____.
Hint
In a table, what is another name for a row of related details?
Answer
records
Explanation
In a relational database, each record is represented by a row containing related attribute values.
- 7A unique identifier used to distinguish a record in a table is its_____.
Hint
Think of the unique identifier that distinguishes one record from others.
Answer
primary key
Explanation
A primary key identifies a particular record in a table.
- 8The location where an attribute is stored is called a_____.
Hint
Think of a location in a table where an attribute's value is kept.
Answer
field
Explanation
A field is a location in which an attribute is stored.
- 9Attributes such as name, age, and address are represented by table_____.
Hint
In a table, which direction represents attributes shared by records?
Answer
columns
Explanation
Columns represent attributes that describe the records in a table, such as name, age, or address.
- 10The individual records in a table are stored as_____.
Hint
Each horizontal entry holds the details of one record.
Answer
rows
Explanation
Rows are records, each containing details for a particular entry in the table.
- 11In a database,_____represents a missing value rather than the number zero.
Hint
This database value indicates that information is absent rather than numerically zero.
Answer
NULL
Explanation
A NULL value represents missing or empty information for an attribute; it is not the same as zero.
- 12To require that an attribute always have a value, define it as_____.
Hint
Which setting prevents an attribute from having a missing value?
Answer
NOT NULL
Explanation
The NOT NULL constraint requires an attribute to have a value and prevents it from being left empty.
- 13Rules that restrict which data can be entered into a table are called_____.
Hint
Think of table rules that limit which data is acceptable.
Answer
constraints
Explanation
Constraints define rules that restrict what data can be entered into a table.
- 14A table stores a unique set of data with a_____across its records.
Hint
Think of what remains structured consistently across the records in a table.
Answer
consistent number of typed data attributes
Explanation
A table contains a consistent set of columns, each representing a typed data attribute.
- 15A table uses a_____to uniquely identify each of its records.
Hint
Which key must be unique for every record?
Answer
primary key
Explanation
A primary key uniquely identifies each record, so its value cannot be duplicated among records in the table.
- 16Because a primary key uniquely identifies each record, it helps avoid identification issues caused by_____.
Hint
A unique identifier avoids problems caused by repeated or non-unique identifying details.
Answer
redundancy
Explanation
A unique primary key helps locate a record without relying on potentially repeated values such as names, reducing identification problems caused by redundancy.
- 17A child table uses a_____to refer to a primary key in its parent table.
Hint
The key in the child table refers back to a key in the parent table.
Answer
foreign key
Explanation
A primary key from a parent table can be stored in a child table as a foreign key to define their relationship.
- 18When a child table refers to another table's primary key, the referenced table is the_____.
Hint
Which side of a parent-child relationship supplies the referenced key?
Answer
parent
Explanation
In the described parent-child relationship, the table whose primary key is referenced is the parent table.
- 19In a parent-child table relationship, the table containing the foreign key is the_____.
Hint
Which side contains the key that points to the parent?
Answer
child
Explanation
The child table contains the foreign key that refers to the primary key in the parent table.
- 20In a relational database, connections between tables are called_____.
Hint
These connections explain how one table relates to another.
Answer
relationships
Explanation
Relationships describe how tables are connected within a relational database.
- 21The concept that indicates whether a parent-to-child relationship is optional or required is_____.
Hint
Think of whether a table-to-table relationship must exist or may be absent.
Answer
ordinality
Explanation
Ordinality indicates whether the relationship from a parent table to a child table is optional or required.
- 22In the described relationship notation, an optional relationship is represented by a_____.
Hint
The optional relationship is marked with which numeral?
Answer
zero
Explanation
In the described relationship notation, zero indicates that the relationship is optional.
- 23A required relationship is represented by a straight_____.
Hint
The required relationship is indicated by a straight mark rather than a zero.
Answer
perpendicular line
Explanation
A straight perpendicular line indicates that a relationship is required rather than optional.
- 24The concept describing patterns such as one-to-one and one-to-many relationships is_____.
Hint
Think of relationship patterns such as one-to-one and one-to-many.
Answer
cardinality
Explanation
Cardinality describes the type or number pattern of a relationship, such as one-to-one or one-to-many.
- 25When one parent record can relate to multiple child records, the relationship is_____.
Hint
This pattern means one record on one side can relate to multiple records on the other.
Answer
one-to-many
Explanation
One-to-many is one of the relationship types that cardinality can describe.
- 26SQL commands used to define tables and databases belong to_____.
Hint
Which SQL language category is used to define database structures?
Answer
Data Definition Language
Explanation
Data Definition Language (DDL) commands define database structures such as databases and tables.
- 27The DDL command used to create a database or table is_____.
Hint
Which DDL command builds a new database object?
Answer
CREATE
Explanation
CREATE is used to create a database or a table.
- 28To delete a table or database completely, use the_____command.
Hint
Which command removes the table structure as well as the table?
Answer
DROP
Explanation
DROP deletes a table or database itself, rather than merely emptying it.
- 29The command that removes a table's records while keeping its structure is_____.
Hint
Which command empties a table but keeps its name and attributes?
Answer
TRUNCATE
Explanation
TRUNCATE removes all records from a table while leaving the table structure available for reuse.
- 30The DDL command used to change a table's structure is_____.
Hint
Which DDL command modifies a table definition?
Answer
ALTER
Explanation
ALTER is used to change a table's structure or definition.
- 31The command described as adding notes to a data dictionary is_____.
Hint
Which command is used to add explanatory notes to a data dictionary?
Answer
comment
Explanation
The content describes the comment command as a way to add comments to a data dictionary.
- 32Commands used to manipulate data in a database belong to_____.
Hint
Which SQL language category covers commands that manipulate database data?
Answer
Data Manipulation Language
Explanation
Data Manipulation Language (DML) commands are used to work with data in a database.
- 33To select a particular database for subsequent work, use the_____command.
Hint
Which command switches the active database?
Answer
USE
Explanation
USE selects a particular database to work with when multiple databases are available.
- 34The command used to add values into a table is_____.
Hint
Which command adds new records to a table?
Answer
INSERT INTO
Explanation
INSERT INTO adds values to a table.
- 35To change values in existing records, use the_____command.
Hint
Which command corrects or changes values in existing rows?
Answer
UPDATE
Explanation
UPDATE changes values in existing records, often targeting records with a WHERE clause.
- 36To remove a particular record from a table, use the_____command.
Hint
Which command removes rows rather than changing their values?
Answer
DELETE
Explanation
DELETE removes selected records from a table; a WHERE clause can target particular rows.
- 37The command used to retrieve data from a table is_____.
Hint
Which command asks a database to return chosen data?
Answer
SELECT
Explanation
SELECT retrieves or queries data from a table.
- 38Commands that manage database access privileges belong to_____.
Hint
Which SQL language category covers granting and withdrawing access privileges?
Answer
Data Control Language
Explanation
Data Control Language (DCL) includes commands that manage users' database privileges.
- 39The DCL command that gives users access privileges is_____.
Hint
Which command gives users database privileges?
Answer
GRANT
Explanation
GRANT gives a user privileges to access a database.
- 40The DCL command that withdraws previously granted privileges is_____.
Hint
Which command takes back previously assigned database privileges?
Answer
REVOKE
Explanation
REVOKE withdraws privileges that were previously granted to a user.
- 41CRUD stands for_____, the four basic operations performed on data.
Hint
Expand the four letters in CRUD as basic data actions.
Answer
create, read, update, and delete
Explanation
CRUD stands for create, read, update, and delete, the basic operations performed on data.
- 42Commands that control database transactions belong to_____.
Hint
Which SQL language category includes commands that commit or roll back transactions?
Answer
Transaction Control Language
Explanation
Transaction Control Language (TCL) includes commands that control transactions, such as COMMIT and ROLLBACK.
- 43To save changes made in a transaction, use_____.
Hint
Which transaction command makes changes permanent?
Answer
COMMIT
Explanation
COMMIT saves the changes made in a transaction.
- 44To undo transaction changes and return to the previous committed state, use_____.
Hint
Which command undoes uncommitted transaction changes?
Answer
ROLLBACK
Explanation
ROLLBACK reverses changes in a transaction and returns to the previous committed state.
- 45The transaction command that marks a point for later reference is_____.
Hint
This command marks a point in a transaction, much like saving progress in a game.
Answer
SAVEPOINT
Explanation
SAVEPOINT creates a named point within a transaction that can be used as a reference during transaction control.
- 46To specify characteristics for a transaction, use_____.
Hint
Which command is used to specify transaction characteristics?
Answer
SET TRANSACTION
Explanation
SET TRANSACTION specifies characteristics for a transaction.
- 47In the demonstrated MySQL commands, a query is ended with a_____.
Hint
Which punctuation mark terminates a query in the demonstration?
Answer
semicolon
Explanation
In the demonstrated MySQL interaction, a semicolon at the end tells MySQL that the query is complete.
- 48To retrieve every column from the customer table, write_____.
Hint
The star is a wildcard meaning all columns; use it with the customer table.
Answer
SELECT star FROM customer
Explanation
The star selects all columns, so this query returns all attributes from the customer table.
- 49The clause used to target records that meet a condition is_____.
Hint
Which clause narrows query results to records meeting a condition?
Answer
WHERE
Explanation
WHERE filters rows so a query can target records that match a condition.
- 50To find customers who meet a city condition and a product condition at the same time, connect the conditions with_____.
Hint
Use this logical operator when both specified conditions must be satisfied.
Answer
AND
Explanation
AND requires both conditions in a query to be true, such as matching both a city and a product.
- 51To arrange query results according to a chosen column, use_____.
Hint
Which clause arranges the returned rows according to a column?
Answer
ORDER BY
Explanation
ORDER BY sorts query results using the selected column.
- 52If an ORDER BY direction is omitted, results are sorted in_____order by default.
Hint
The default order proceeds from lower values to higher values.
Answer
ascending
Explanation
When no direction is specified for ORDER BY in the described behavior, results are ordered ascending by default.
- 53To sort results from higher values to lower values, add_____to ORDER BY.
Hint
Which short keyword requests the reverse of ascending order?
Answer
DESC
Explanation
DESC requests descending order, placing higher values before lower values.
- 54To calculate the total income across selected records, use the_____function.
Hint
Which aggregate function adds values together?
Answer
SUM
Explanation
SUM calculates the total of the values in a numeric column, optionally after filtering rows.
- 55To calculate the average value in a column, use the_____function.
Hint
Which aggregate function computes the mean?
Answer
AVG
Explanation
AVG calculates the average of values in a column.
- 56To find the highest income in a column, use the_____function.
Hint
Which aggregate function finds the greatest value?
Answer
MAX
Explanation
MAX returns the largest value in a column.
- 57To find the lowest income in a column, use the_____function.
Hint
Which aggregate function finds the least value?
Answer
MIN
Explanation
MIN returns the smallest value in a column.
- 58To count customer entries in a query result, use the_____function.
Hint
Which aggregate function returns how many entries match?
Answer
COUNT
Explanation
COUNT counts values or records matching the query; the described example counts a non-null name field.
- 59To return each customer name only once even if it appears in multiple records, use_____.
Hint
Which keyword eliminates duplicate values from a result?
Answer
DISTINCT
Explanation
DISTINCT removes duplicate values from the query results, allowing each name to appear only once.
- 60To retrieve related fields from the customer and product tables together, use a_____.
Hint
Which query operation brings together related rows from different tables?
Answer
JOIN
Explanation
JOIN combines related data from multiple tables so fields from both can be returned in one query.
- 61In the product model table, the field that refers to the associated customer record is the_____.
Hint
Which field in a product record points back to its customer?
Answer
customer ID
Explanation
The customer ID in the product table refers to a customer record and serves as a foreign key.
- 62In the table demonstration, the ID and age attributes use the_____data type.
Hint
Which data type is appropriate for whole-number values such as age or an ID?
Answer
integer
Explanation
The demo defines ID and age as integer-valued attributes using the integer type.
- 63The demo uses_____for text attributes such as names and cities.
Hint
Which type is used for text whose length can vary up to a specified limit?
Answer
VARCHAR
Explanation
VARCHAR is used for variable-length character strings such as names, cities, and product names.
- 64In the demonstration, the name field is defined as VARCHAR with a limit of_____characters.
Hint
What character limit was used for the example name and city fields?
Answer
30
Explanation
The demonstrated VARCHAR attributes for name, city, and product are assigned a limit of 30 characters.
- 65To have MySQL automatically advance an ID for each inserted record, use_____.
Hint
Which setting automatically generates the next identifier for a new row?
Answer
AUTO INCREMENT
Explanation
AUTO INCREMENT automatically advances the ID when a new record is inserted, avoiding manual ID entry.
- 66In the MySQL demonstration, the command that lists databases is_____.
Hint
Which command displays the available databases?
Answer
show databases
Explanation
The demonstrated show databases command lists the databases available in MySQL.
- 67In the MySQL demonstration, the command that lists tables is_____.
Hint
Which command lists tables in the selected database?
Answer
show tables
Explanation
The demonstrated show tables command lists the tables in the currently selected database.
- 68After creating a database, the demonstration selects it with the_____command.
Hint
Which command makes a chosen database active?
Answer
use
Explanation
The USE command selects a database and makes it the active database for subsequent work.
- 69A_____constraint prevents a product record from referring to a nonexistent customer record.
Hint
Which constraint checks that a reference in one table matches a record in another?
Answer
foreign key
Explanation
The foreign key constraint ensures that a referenced customer ID corresponds to a valid customer record, preventing a product row from referring to a nonexistent customer.
- 70The foreign-key option used to cascade a parent deletion to related rows is_____.
Hint
Which foreign-key option makes deletion of a parent affect related child rows?
Answer
ON DELETE CASCADE
Explanation
ON DELETE CASCADE specifies that deleting a referenced parent record can cascade to related child records.

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