Clauses, Queries, And Syntax Flashcards
(47 cards)
What does SQL stand for?
Structured Query Language
True or False: SQL is a programming language.
False
What is the purpose of the SELECT statement in SQL?
To retrieve data from a database.
Fill in the blank: The SQL clause that specifies the table to query is called ____.
FROM
Which SQL clause is used to filter records?
WHERE
What keyword is used to sort the result set in SQL?
ORDER BY
True or False: The GROUP BY clause is used to arrange identical data into groups.
True
What does the HAVING clause do in SQL?
It filters records after grouping.
What is the default sorting order of the ORDER BY clause?
Ascending
Which SQL function is used to count the number of rows?
COUNT()
What keyword is used to add new records to a table?
INSERT INTO
Fill in the blank: To modify existing records in a table, you use the ____ statement.
UPDATE
What does the DELETE statement do in SQL?
Removes records from a table.
True or False: The SQL statement ‘SELECT * FROM table_name’ retrieves all columns from a table.
True
What is the purpose of the DISTINCT keyword in SQL?
To return only unique values.
Fill in the blank: In SQL, a ____ is a set of data stored in a table.
record
What is the primary key in a database?
A unique identifier for a record in a table.
What SQL clause is used to combine records from two or more tables?
JOIN
Which type of JOIN returns all records from both tables, with matches where available?
FULL OUTER JOIN
What is the purpose of the LIMIT clause in SQL?
To specify the maximum number of records to return.
True or False: SQL supports both single-line and multi-line comments.
True
What is the syntax to create a new table in MySQL?
CREATE TABLE table_name (column1 datatype, column2 datatype, …);
Fill in the blank: The SQL function ____ is used to find the highest value in a column.
MAX()
What does the SQL command ‘ALTER TABLE’ do?
Modifies an existing table structure.