SQL Usage Flashcards

1
Q

What is a field also known as?

A

An attribute

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

What is a row also called?

A

A record

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

SQL keywords are ____ case sensitive

A

NOT

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

SQL SELECT specific columns

A

SELECT column1, column2, …
FROM table_name;

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

Select ALL columns

A

SELECT * FROM table_name;

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

SQL SELECT DISTINCT Statement

A

SELECT DISTINCT column1, column2, …
FROM table_name;

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

Count Distinct

A

SELECT COUNT(DISTINCT column_name) FROM table_name;

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

The SQL WHERE Clause

A

SELECT column1, column2, …
FROM table_name
WHERE condition;

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

Operators that can be used with WHERE clause (9)

A

=
>
<
>=
<=
<> (!= - in some SQL versions)
BETWEEN x AND Y
LIKE
IN

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

SQL ORDER BY

A

SELECT column1, column2, …
FROM table_name
ORDER BY column1, column2, … ASC|DESC;

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

SQL AND Operator

A

SELECT column1, column2, …
FROM table_name
WHERE condition1 AND condition2 AND condition3 …;

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

SQL OR Operator

A

SELECT column1, column2, …
FROM table_name
WHERE condition1 OR condition2 OR condition3 …;

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

NOT Operator

A

SELECT column1, column2, …
FROM table_name
WHERE NOT condition;

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

SQL INSERT INTO

A

INSERT INTO table_name (column1, column2, column3, …)
VALUES (value1, value2, value3, …);

or

INSERT INTO table_name
VALUES (value1, value2, value3, …);

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

IS NULL Syntax

A

SELECT column_names
FROM table_name
WHERE column_name IS NULL;

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

IS NOT NULL Syntax

A

SELECT column_names
FROM table_name
WHERE column_name IS NOT NULL;

17
Q

SQL UPDATE

A

UPDATE table_name
SET column1 = value1, column2 = value2, …
WHERE condition;

18
Q

SQL DELETE

A

DELETE FROM table_name WHERE condition;

19
Q

SQL SELECT TOP

A

SELECT column_name(s)
FROM table_name
WHERE condition
LIMIT number;

20
Q

SQL MIN()

A

SELECT MIN(column_name)
FROM table_name
WHERE condition;

21
Q

SQL MAX()

A

SELECT MAX(column_name)
FROM table_name
WHERE condition;

22
Q

Set Column Name (Alias)

A

SELECT MIN(Price) AS SmallestPrice
FROM Products;

23
Q

SQL COUNT()

A

SELECT COUNT(column_name)
FROM table_name
WHERE condition;

24
Q

SQL SUM()

A

SELECT SUM(column_name)
FROM table_name
WHERE condition;

25
Q

SQL AVG()

A

SELECT AVG(column_name)
FROM table_name
WHERE condition;

26
Q

SQL LIKE

A
27
Q
A