Basic SQL Definitions Flashcards

Learn the definitions of basic SQL commands.

1
Q

This lets you add columns to a table in a database.

A

ALTER TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

This is an operator that combines two conditions. Both conditions must be true for the row to be included in the result set.

A

AND

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

This is a keyword in SQL that allows you to rename a column or table using an alias.

A

AS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This is an aggregate function that returns the average value for a numeric column.

A

AVG()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

This operator is used to filter the result set within a certain range. The values can be numbers, text or dates

A

BETWEEN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

These statements are used to create different outputs (usually in the SELECT statement). It is SQL’s way of handling if-then logic.

A

CASE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

This is a function that takes the name of a column as an argument and counts the number of rows where the column is not NULL.

A

COUNT()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

This creates a new table in the database. It allows you to specify the name of the table and the name of each column in the table.

A

CREATE TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

These statements are used to remove rows from a table.

A

DELETE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

This is a clause in SQL that is only used with aggregate functions. It is used in collaboration with the SELECT statement to arrange identical data into groups.

A

GROUP BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This was added to SQL because the WHERE keyword could not be used with aggregate functions.

A

HAVING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

This will combine rows from different tables if the join condition is true.

A

INNER JOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

These statements are used to add a new row to a table.

A

INSERT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

These are operators used with the WHERE clause to test for empty values.

A

IS NULL and IS NOT NULL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

This is a special operator used with the WHERE clause to search for a specific pattern in a column.

A

LIKE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

This is a clause that lets you specify the maximum number of rows the result set will have.

A

LIMIT

17
Q

This is a function that takes the name of a column as an argument and returns the largest value in that column.

A

MAX()

18
Q

This is a function that takes the name of a column as an argument and returns the smallest value in that column.

A

MIN()

19
Q

This is an operator that filters the result set to only include rows where either condition is true.

A

OR

20
Q

This is a clause that indicates you want to sort the result set by a particular column either alphabetically or numerically.

A

ORDER BY

21
Q

This will combine rows from different tables even if the join condition is not met. Every row in the left table is returned in the result set, and if the join condition is not met, then NULL values are used to fill in the columns from the right table.

A

OUTER JOIN

22
Q

This is a function that takes a column name and an integer as an argument. It rounds the values in the column to the number of decimal places specified by the integer.

A

ROUND()

23
Q

These statements are used to fetch data from a database. Every query will begin with this command.

A

SELECT

24
Q

This specifies that the statement is going to be a query that returns unique values in the specified column(s).

A

SELECT DISTINCT

25
Q

This is a function that takes the name of a column as an argument and returns the sum of all the values in that column.

A

SUM()

26
Q

These statements allow you to edit rows in a table.

A

UPDATE

27
Q

This is a clause that indicates you want to filter the result set to include only rows where the following condition is true.

A

WHERE

28
Q

This clause lets you store the result of a query in a temporary table using an alias. You can also define multiple temporary tables using a comma and with one instance of the keyword.

This clause is also known as common table expression (CTE) and subquery factoring.

A

WITH