SQL-DBC Exam Study Guide
SQL-DBC Exam Study Guide Give me a list of all invoices - answerSELECT * FROM INVOICES Get name of all invoices - answerSELECT name FROM INVOICES Give me the first and last names of every employee - answerSELECT first_name, last_name FROM employees; Give me a list of every employee by hire date in descending order - answerSELECT * FROM employees ORDER BY hire_date DESC; Give me a list of all artists sorted alphabetically by first name - answerSELECT * FROM artists ORDER BY name ASC; Give me the hire date, first name, and last name of all employees hired before February 15, 2011 - answerSELECT hire_date, first_name, last_name FROM employees WHERE hire_date ''; All employees where the first_name begins with A - answerSELECT * FROM employees WHERE first_name LIKE 'A%'; Give me a list of all names of artists whose name contains "smith". - answerSELECT name FROM artists WHERE name LIKE '%smith%'; Give me a list of all invoices from Redmond, WA - answerSELECT * FROM invoices WHERE billing_city = 'Redmond' AND billing_state = 'WA' Give me a list of every track without a composer - answerSELECT * FROM tracks WHERE composer is null; Give me a list of all invoices from Redmond, WA sorted from low-to-high by total - answerselect * from invoices where billing_city = 'Redmond' and billing_state = 'WA' ORDER BY total ASC; Give me a list of the 10 most expensive invoices from Germany - answerselect * from invoices where billing_country = 'Germany' ORDER BY total DESC LIMIT 10; Give me a list of all invoices from either Cupertino, CA or Mountain View, CA - answerselect * from invoices where billing_city = 'Cupertino' OR billing_city = 'Mountain View' AND billing_state = 'CA'; Find the number of invoices sent to the city of "Santiago" - answerselect count(*) from invoices where billing_city = 'Santiago';
Document information
- Uploaded on
- July 3, 2024
- Number of pages
- 3
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers