Section 1

Preview this deck

What is the most common type of join?

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

3

All-time users

3

Favorites

0

Last updated

1 year ago

Date created

Mar 1, 2020

Cards (70)

Section 1

(50 cards)

What is the most common type of join?

Front

inner join

Back

For which operator is this statement true? If the test expression is equal to one of the expressions in the list, the row is included in the query results.

Front

IN

Back

LIMIT

Front

specifies the number of rows to return

Back

You can use ——-and———logical operators to creating compound conditions that consist of 2 or more conditions.

Front

AND , OR

Back

SELECT clause - 4 techniques you can use to specify the column for a result set

Front

1. * to retrieve all columns in the base table 2. code a list of column names from the base table separated by commas 3. code an expression that uses arithmetic operations 4. code an expression that uses functions ie. CONCAT

Back

expression

Front

a combination of column names and operators that evaluate to a single value

Back

equijoin

Front

when you use the equal operator to join 2 tables on a common column

Back

The WHERE clause specifies

Front

a search condition that's used to filter the rows in the base table. Specifies the conditions that must be met for a row to be included in the result set.

Back

What happens when you don't assign an alias to a calculated column?

Front

MySQL automatically assigns an alias to the calculated column that is the same as the column's expression.

Back

order of precedence

Front

use this to evaluate arithmetic expressions. it goes from left to right, *,/,DIV,% (MOD), +, -

Back

A row cannot be inserted if.....

Front

the values aren't compatible with the corresponding column data types

Back

left outer join result set includes

Front

all the rows from the first, or left table. if the second table does not have a value, it displays as null

Back

A ——-is simply a select statement within another statement.

Front

Subquery

Back

What clause is used to specify a column name?

Front

AS

Back

What operator allows you to search for complex string patterns?

Front

REGEXP. (Regular expressions)

Back

What is a table created using the CREATE statement missing?

Front

definitions of PK, FK, and indexes

Back

Alias is created by using what clause?

Front

AS

Back

DIV returns

Front

the integer quotient of the two numbers (quotient: a result obtained by dividing one quantity by another.)

Back

ORDER BY

Front

specifies how to sot the rows in the result set

Back

SELECT invoice_number AS "Invoice Number". Why is invoice number is in double quotes?

Front

to include a space

Back

SELECT

Front

describes the columns in the result set

Back

like a join a _____ combines data from 2 or more tables. instead of combining columns from base tables, it combines rows from 2 or more result sets.

Front

union

Back

What does the join condition indicate?

Front

how 2 tables should be compared

Back

T or F DEFAULT and NULL are used when inserting values if a column list isn't used?

Front

True INSERT INTO color_sample VALUES (DEFAULT, DEFAULT, NULL)

Back

T or F When you code a literal value for a number, you don't need to enclose it in quotes.

Front

True

Back

T or F you can only use the "USING" clause if the tables include a column with the same name.

Front

true

Back

Implicit Syntax vs Explicit Syntax

Front

-explicit are easier to read because it lets you separate join conditions from search conditions -implicit is older and not as widely used -implicit can result in a cross join which returns a large number of rows -when you use implicit for an inner join, you code the tables in the FROM clause separated by commas. Then you code the JOIN conditions in the WHERE clause. ie. SELECT invoice_number, vendor_name FROM vendors v, invoices i WHERE v.vendor_id = i.vendor_id ORDER BY invoice_number Explicit this is written as SELECT invoice_number, vendor_name FROM vendors INNER JOIN invoices ON vendors.vendor_id = invoices.vendor_id ORDER BY invoice_number

Back

What values can be omitted from a VALUES clause?

Front

ones with a default, accepts null values, or are automatically generated

Back

T or F Unless parenthesis are used, the operations in an expression take place from left to right in order of precedence.

Front

T

Back

Tables are typically joined on the relationship between the ________ and the ___________ of another.

Front

primary key; foreign key

Back

What do you need to include if you don't INSERT INTO using a column list?

Front

the VALUES clause must include a value for every column in the table and they must be listed in the same sequence.

Back

How do you code a qualified column when joining?

Front

type the table name followed by a period followed by the column name. example the column name vendor_id is the same in both tables so you need to qualify it by adding the table name

Back

SELECT * FROM - will select what?

Front

all columns and rows of a table

Back

what is the syntax for the INSERT clause?

Front

specify the name of the table you want to add a row to (INSERT INTO invoices), along with an optional column list (vendor_id, invoice_number, invoice_total). INTO is optional. Follow it with a VALUES clause. VALUES (97, '456789', 8344.50) the values need to be in the same order as the columns list.

Back

a _______ join produces a result set that includes each row from the first table joined with each from from the second table.

Front

cross

Back

if 2 tables have more than one column in common and a natural join is used......

Front

the query would attempt to join both tables and yield an unexpected result

Back

in a _______ join the database automatically joins the two tables based on all columns in the two tables that have the same name.

Front

natural join

Back

What operator allows you to search for simple string patterns?

Front

Like

Back

What rows are included when you inner join?

Front

Only those rows that satisfy the join.

Back

T or F The two expressions used in the between phrases for the range of values are inclusive.

Front

T

Back

The search condition of a WHERE clause consists of....

Front

one or more Boolean expressions that result in a true, false, or null value.

Back

MOD returns

Front

the remainder of a division of two integers

Back

When MySQL evaluates a compound condition, it evaluates the operators in wha t sequence?

Front

NOT, AND, OR (parentheses can be used to override the order)

Back

Default sort for ORDER BY clause

Front

descending - largest to smallest

Back

5 main clauses of SELECT statements

Front

1. SELECT 2. FROM 3. WHERE 4. ORDER BY 5. LIMIT

Back

how is the code different when doing an equijoin vs other joins?

Front

you code a USING clause instead of an ON clause to specify the join

Back

What kind of join returns all of the rows from one of the tables involved in the join, regardless of whether the join condition is true?

Front

outer join

Back

cartesian product

Front

the result of a cross join

Back

FROM

Front

names the base table from which the query retrieves data

Back

What is the MySQL default format for a date?

Front

YYYY-MM-DD

Back

Section 2

(20 cards)

Mask REGEXP NA$ returns

Front

Anything where Na is at the end

Back

What is the default sequence for the ORDER BY clause?

Front

ASC

Back

For a ________join, only those rows that satisfy the join condition are included.

Front

Inner

Back

Why must columns be qualified?

Front

Anytime columns from multiple tables have the same name. So MySQL can tell which table they came from Ex. Vendors.vendor_id

Back

A ________join us a join that joins a table to itself.

Front

Self

Back

T or F You can sort by any column in the base table regardless of whether it's included in the SELECT statement.

Front

True

Back

Ascending sort order:

Front

Null values first even if sort is DESC,Special characters, followed by numbers, then letters

Back

What is the most common type of join?

Front

Inner

Back

Mask REGEXP ^ SA returns

Front

Anything with SA at the beginning. Ie Santa Anna or Sacramento

Back

If you want to retrieve all of the rows from a certain offset to the end of the results set code ——-for the row count.

Front

-1

Back

Table alias are assigned in the __________clause.

Front

FROM

Back

T or F A null value is not the same as zero or an empty string (' ').

Front

True

Back

Term for when one sort is nested within another.

Front

Nested sort

Back

Another word for database.

Front

Schema

Back

What will REGEXP 'SA' return?

Front

Words where SA is anywhere within a string. Ie Pasadena or Santa Anna

Back

A ——— lets you combine columns from two or more tables into a single result set.

Front

Join

Back

What clause specifies how you want rows in the result set sorted?

Front

ORDER BY

Back

LIKE and REGEXP searches run slowly why?

Front

They can't use tables index.

Back

A ——- can be used to search for either of the two string patterns.

Front

Pipe ie REGEXP 'RS | SN'

Back

When you code a self-join, you must use aliases for the ___________, and you must qualify each ___________ name with the alias.

Front

Tables, column

Back