1/36
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What does SQL stand for?
Structured Query Language.
What is the primary purpose of SQL?
To access and manipulate databases.
When did SQL become a standard of ANSI and ISO?
ANSI in 1986 and ISO in 1987.
What is the function of the SELECT command in SQL?
It is used to query and retrieve data from a database.
What does the SELECT * statement do?
Retrieves all columns from a table.
What is the purpose of the SELECT DISTINCT statement?
Returns only distinct (unique) values in a column.
What does the ORDER BY clause do?
Sorts the result set in ascending or descending order.
What are arithmetic operators used for in SQL?
To perform mathematical operations on numeric data.
List the arithmetic operators used in SQL.
+ (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulo).
What is a column alias in SQL?
A temporary name given to a column in the result set, often using the AS keyword.
What is a table alias in SQL?
A temporary name given to a table, useful in queries involving multiple tables.
What does the ALTER TABLE command do?
Modifies an existing table by adding, modifying, or dropping columns.
What is the DROP TABLE command used for?
To delete an entire table from a database along with all its data.
What does the RENAME command do in SQL?
Allows you to rename an existing table.
What does CRUD stand for?
Create, Read, Update, Delete.
How do you add data to a table in SQL?
Using the INSERT INTO statement.
What SQL statement is used to retrieve data?
The SELECT statement.
How do you update existing records in SQL?
Using the UPDATE statement along with a WHERE condition.
What is the purpose of the LIMIT clause in SQL?
To restrict the number of rows returned by a query.
What is the significance of using aliases in SQL?
To improve readability and provide temporary names for tables or columns.
What is the purpose of the DELETE FROM statement in SQL?
To delete data from a table based on a specified WHERE condition.
What is a constraint in SQL?
A rule applied to a column in a table to control the kind of data that can be stored in that column.
What does the NOT NULL constraint ensure?
That a column cannot have a NULL value.
What is the DEFAULT constraint used for?
To assign a default value to a column if no value is provided during an insert.
What does the UNIQUE constraint do?
Ensures that all values in a column (or group of columns) are distinct.
What is the PRIMARY KEY constraint?
Uniquely identifies each row in a table and automatically applies NOT NULL and UNIQUE.
What is the purpose of the FOREIGN KEY constraint?
Enforces a link between two tables, ensuring that the value in one column matches a value in another table's primary key.
What is a single-row function in SQL?
A function that takes input from one row and returns a single value for that row.
What are the key characteristics of single-row functions?
They operate on one row at a time and return one result per input row.
What is the GROUP BY clause used for in SQL?
To group rows that have the same values in specified columns, commonly used with aggregate functions.
What does the COUNT() function do?
Counts the number of rows in a group.
What is the purpose of the DISTINCT keyword in SQL?
Removes duplicate values from the result set, returning unique values only.
What are general functions in SQL?
Functions that handle nulls, data types, and general operations.
What do CASE CONVERSION functions do?
Change the letter case in string data.
What are character functions used for?
To manipulate string data.
What do date functions work with?
Date/time values, allowing extraction of parts of those values.
What do number functions perform operations on?
Numeric values.