database Flashcards
What does SQL stand for?
Structured Query Language
True or False: SQL is a programming language.
True
Fill in the blank: A _______ is a collection of data organized in a structured way.
database
What command is used to retrieve data from a database?
SELECT
Which SQL statement is used to update existing records in a table?
UPDATE
What is the purpose of the WHERE clause in SQL?
To filter records based on a specified condition.
True or False: The DELETE statement in SQL is used to remove records from a table.
True
What is the default sorting order of the ORDER BY clause?
Ascending
Which SQL statement is used to create a new table?
CREATE TABLE
What keyword is used to prevent duplicate values in a column?
UNIQUE
Fill in the blank: A _______ key uniquely identifies each record in a table.
primary
What is the purpose of the JOIN clause in SQL?
To combine rows from two or more tables based on a related column.
Which type of JOIN returns all records from the left table and matched records from the right table?
LEFT JOIN
What is a foreign key?
A field in one table that uniquely identifies a row of another table.
True or False: The COUNT function in SQL can be used to count rows in a table.
True
What SQL function is used to find the highest value in a column?
MAX
Fill in the blank: The _______ function is used to calculate the average value of a numeric column.
AVG
What command is used to remove a table from a database?
DROP TABLE
What does the GROUP BY clause do in SQL?
It groups rows that have the same values in specified columns into summary rows.
Which SQL clause is used to filter groups based on a specified condition?
HAVING
What is the purpose of the DISTINCT keyword in SQL?
To return only unique values.
True or False: An index in SQL can improve the speed of data retrieval.
True
What SQL command is used to add a new column to an existing table?
ALTER TABLE
What is the purpose of the NULL value in SQL?
To represent missing or unknown data.