You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Willy Vervest 685de134e8 oef java 2 years ago
jsbootcamp @ b51368765f oef java 2 years ago
.gitmodules oef java 2 years ago
Exec_2.sql oef2 2 years ago
Exec_3.sql oef3 2 years ago
Exec_3_21-C.SQL oef 2 years ago
Exec_3_21.sql oef 2 years ago
Exec_3_22-C.SQL oef 2 years ago
Exec_3_22.sql oef 2 years ago
Exec_3_23-C.SQL oef 2 years ago
Exec_3_23.sql oef 2 years ago
Exec_3_24-C.SQL oef 2 years ago
Exec_3_24.SQL oef 2 years ago
Exec_3_25-C.sql oef 2 years ago
Exec_3_25.sql oef 2 years ago
Exec_3_26.sql oef 2 years ago
Exec_3_27.sql oef 2 years ago
Exec_4.sql oef4 2 years ago
Exec_4_21.sql oef 2 years ago
Exec_4_22.sql oef 2 years ago
Exec_4_23.sql oef 2 years ago
Exec_4_24.sql oef 2 years ago
Exec_4_25.sql oef 2 years ago
Exec_4_26.sql oef 2 years ago
Exec_4_27.sql oef 2 years ago
Exec_4_28.sql oef 2 years ago
Exec_4_29.sql oef 2 years ago
Exec_5.sql oef5 2 years ago
Exec_6.sql oef6 2 years ago
Exec_7.sql oef7 2 years ago
Exer_1.sql oef1 2 years ago
README.md 'README.md' updaten 2 years ago
exec_5C31.sql oef 2 years ago
exec_5C32.sql oef 2 years ago
exec_5C33.sql oef 2 years ago
exec_5C34.sql oef 2 years ago
exec_5C35.sql oef 2 years ago
exec_5C36.sql oef 2 years ago
exec_5C37.sql oef 2 years ago
exec_5C38.sql oef 2 years ago
exec_5C39.sql oef 2 years ago
exec_5C61.sql oef 2 years ago
exec_5C62.sql oef 2 years ago
exec_5C63.sql oef 2 years ago
exec_5C64.sql oef 2 years ago
exec_5C65.sql oef 2 years ago
exec_5C66.sql oef 2 years ago
exec_5C67.sql oef 2 years ago
exec_5C68.sql oef 2 years ago
exec_5C69.sql oef 2 years ago
exec_5C70.sql oef 2 years ago
exec_5C71.sql oef 2 years ago
exec_5C72.sql oef 2 years ago
exec_5C73.sql oef 2 years ago
exec_5C74.sql oef 2 years ago
exec_5C75.sql oef 2 years ago
exec_5C76.sql oef 2 years ago
exer_5C1.sql oef 2 years ago
exer_5C2.sql oef 2 years ago
exer_5C3.sql oef 2 years ago
exer_5C4.sql oef 2 years ago
exer_5C5.sql oef 2 years ago
exer_5C6.sql oef 2 years ago
exer_5C7.sql oef 2 years ago
exer_5C8.sql oef 2 years ago
exer_5C9.sql oef 2 years ago
exer_5C10.sql oef 2 years ago
exer_5C11.sql oef 2 years ago
exer_5C12.sql oef 2 years ago
exer_5C13.sql oef 2 years ago
exer_5C14.sql oef 2 years ago
exer_5C15.sql oef 2 years ago
exer_5C16.sql oef 2 years ago
exer_5C17.sql oef 2 years ago
exer_5C18.sql oef 2 years ago
exer_5C19.sql oef 2 years ago
exer_5C20.sql oef 2 years ago
exer_5C21.sql oef 2 years ago
exer_5C22.sql oef 2 years ago
exer_5C23.sql oef 2 years ago
exer_5C24.sql oef 2 years ago
exer_5C25.sql oef 2 years ago
exer_5C26.sql oef 2 years ago
exer_5C27.sql oef 2 years ago
exer_5C28.sql oef 2 years ago
exer_5C29.sql oef 2 years ago
exer_5C30.sql oef 2 years ago
exer_5C40.sql oef 2 years ago
exer_5C41.sql oef 2 years ago
exer_5C42.sql oef 2 years ago
exer_5C43.sql oef 2 years ago
exer_5C44.sql oef 2 years ago
exer_5C45.sql oef 2 years ago
exer_5C46.sql oef 2 years ago
exer_5C47.sql oef 2 years ago
exer_5C48.sql oef 2 years ago
exer_5C49.sql oef 2 years ago
exer_5C50.sql oef 2 years ago
exer_5C51.sql oef 2 years ago
exer_5C52.sql oef 2 years ago
exer_5C53.sql oef 2 years ago
exer_5C54.sql oef 2 years ago
exer_5C55.sql oef 2 years ago
exer_5C56.sql oef 2 years ago
exer_5C57.sql oef 2 years ago
exer_5C58.sql oef 2 years ago
exer_5C59.sql oef 2 years ago
exer_5C60.sql oef 2 years ago
exercise1.sql dit is een test 2 years ago

README.md

How to retrieve data from a single table

Exercise 1

Write a SELECT statement that returns three columns from the Vendors table: vendor_name, vendor_contact_last_name, and vendor_contact_first_name. Then, run this statement to make sure it works correctly.

Add an ORDER BY clause to this statement that sorts the result set by last name and then first name, both in ascending sequence. Then, run this state‐ment again to make sure it works correctly.

This is a good way to build and test a statement, one clause at a time.

Exercise 2

Write a SELECT statement that returns one column from the Vendors table named full_name that joins the vendor_contact_last_name and vendor_contact_first_name columns. Format this column with the last name, a comma, a space, and the first name like this:

Doe, John

Sort the result set by last name and then first name in ascending sequence. Return only the contacts whose last name begins with the letter A, B, C, or E. This should retrieve 41 rows.

Exercise 3

Write a SELECT statement that returns these column names and data from the Invoices table:

Due Date (The invoice_due_date column) Invoice Total (The invoice_total column) 10% (10% of the value of invoice_total) Plus 10% (The value of invoice_total plus 10%)

Return only the rows with an invoice total that’s greater than or equal to 500 and less than or equal to 1000. This should retrieve 12 rows.

Sort the result set in descending sequence by invoice_due_date.

Exercise 4

Write a SELECT statement that returns these columns from the Invoices table:

invoice_number (The invoice_number column) invoice_total (The invoice_total column) payment_credit_total (Sum of the payment_total and credit_total columns) balance_due (The invoice_total column minus the payment_total and credit_total columns)

Return only invoices that have a balance due that’s greater than $50.

Sort the result set by balance due in descending sequence.

Use the LIMIT clause so the result set contains only the rows with the 5 largest balances.

Exercise 5

Write a SELECT statement that returns these columns from the Invoices table:

invoice_number (The invoice_number column) invoice_date (The invoice_date column) balance_due (The invoice_total column minus the payment_total and credit_total columns) payment_date (The payment_date column)

Return only the rows where the payment_date column contains a null value. This should retrieve 11 rows.

Exercise 6

Write a SELECT statement without a FROM clause that uses the CURRENT_DATE function to return the current date in its default format.

Use the DATE_FORMAT function to format the current date in this format: mm-dd-yyyy

This displays the month, day, and four‐digit year of the current date.

Give this column an alias of current_date. To do that, you must enclose the alias in quotes since that name is already used by the CURRENT_DATE function.

Exercise 7

Write a SELECT statement without a FROM clause that creates a row with these columns:

starting_principal (Starting principal of $50,000) interest (6.5% of the principal) principal_plus_interest (The principal plus the interest)

To calculate the third column, add the expressions you used for the first two columns.