Section 1

Preview this deck

SELECT * FROM Customers ORDER BY Country ASC, CustomerName DESC;

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (48)

Section 1

(48 cards)

SELECT * FROM Customers ORDER BY Country ASC, CustomerName DESC;

Front

Extracts Customers table and sorts by Country ascending, then sorts by CustomerName descending

Back

NULL values and comparison operators

Front

It is not possible to test for NULL values with comparison operators, such as =, <, or <>. You will need to use IS NULL or IS NOT NULL operators instead.

Back

SELECT DISTINCT Country FROM Customers;

Front

Selects only the DISTINCT values from the "Country" column in the "Customers" table

Back

SELECT column1 FROM table1 WHERE condition1 AND condition2 AND condition3;

Front

Selects values from column1 that meet the conditions of 1 and 2 and 3

Back

INSERT INTO statement

Front

Inserts new data into a database

Back

ALTER TABLE statement

Front

Modifies a table

Back

SELECT CustomerName, City FROM Customers;

Front

Selects the "CustomerName" and "City" columns from the "Customers" table

Back

NULL value

Front

A field with no value. If a field in a table is optional, it is possible to insert a new record or update a record without adding a value to this field. Then, the field will be saved with a NULL value.

Back

Operators: AND, OR and NOT

Front

The WHERE clause can be combined with AND, OR and NOT operators.

Back

WHERE clause

Front

Used to filter records. Used to extract only those records that fulfill a specific condition.

Back

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

Front

Changes fields in column1 to value1 and column2 to value2, where a specific condition exists

Back

CREATE INDEX statement

Front

Creates an index (search key)

Back

SELECT * FROM Customers ORDER BY Country DESC;

Front

Extracts Customers table and sorts by Country descending (z-a)

Back

SELECT COUNT(DISTINCT Country) FROM Customers;

Front

Provides the number of different (distinct) customer countries

Back

Operator: LIKE

Front

Search for a pattern

Back

Operator: <

Front

Less than

Back

DROP TABLE statement

Front

Deletes a table

Back

SELECT * FROM table1 WHERE condition1 AND (condition2 OR condition3);

Front

A statement used when combining AND and OR operators

Back

DELETE * FROM table_name;

Front

Deletes are records from table

Back

SELECT column1 FROM table1 WHERE condition1 OR condition2 OR condition3;

Front

Selects values from column1 that meet the conditions of 1 or 2 or 3

Back

INSERT INTO table_name VALUES (value1, value2, ...)

Front

Used to insert new records into a table without specifying columns. Values enter in the same order as the columns, beginning with column1

Back

CREATE TABLE statement

Front

Creates a new table

Back

Operator: <>

Front

Not equal (some SQL versions: !=)

Back

Operator: >=

Front

Greater than or equal

Back

DELETE statement

Front

Used to delete existing records in a table

Back

DELETE statement

Front

Deletes data from a database

Back

SELECT * FROM Customers;

Front

Selects all the columns from the "Customers" table

Back

INSERT INTO table_name (column1, Column2, ...) VALUES (value1, value2, ...)

Front

Used to insert new records into a table by specifying which columns receive each value.

Back

UPDATE statement

Front

Updates data in a database

Back

INSERT INTO statement

Front

Used to insert new records into a table

Back

UPDATE statement

Front

Used to modify the existing records in a table

Back

SQL stands for

Front

Structured Query Language

Back

SELECT statement

Front

Extracts date from a database

Back

Operator: <=

Front

Less that or equal

Back

Operator: BETWEEN

Front

Between an inclusive range

Back

Operator: IN

Front

To specify multiple possible values for a column

Back

ORDER BY keyward

Front

Used to sort the result-set in ascending or descending order. Ascending by default.

Back

Operator: =

Front

Equal

Back

ASC

Front

Ascending

Back

ALTER DATABASE statement

Front

Modifies a database

Back

SELECT LastName, FirstName, Address FROM Persons WHERE Address IS NOT NULL

Front

Returns noted columns for all rows where there is a value in Address field.

Back

Operator: >

Front

Greater than

Back

UPDATE statement warning

Front

Be careful when updating records. If you omit the WHERE clause, ALL records will be updated.

Back

DESC

Front

Descending

Back

CREATE DATABASE statement

Front

Creates a new database

Back

DELETE FROM table_name WHERE condition;

Front

Deletes field value where specific condition exists. Deletes the entire record (row).

Back

DROP INDEX statement

Front

Deletes an index

Back

SELECT DISTINCT statement

Front

Used to return only distinct (different) values

Back