
Explore three schemas and eleven tables, including grocery (fruit, order, customer, workforce), house (employees, departments, locations, region), and job selection (job bank, applications, references, skill set), with practical table relationships.
Install an Oracle database before the demonstration, use Oracle 11g Express, write queries with the Haskell developer, and verify system type and compatibility on Windows 10 64-bit.
Learn to use Oracle SQL Developer, a graphical user interface to connect to a database and write and retrieve data, and set up the tool by downloading and launching it.
Download the export.sql script to populate data for Zara's Groceries.
Write your first select statement to pull fruit name, fruit type, and quantity from the fruits table, or select all columns with an asterisk.
Describe the table to view its structure and columns, using DSC to reveal the fruit table's columns and data types, plus seven rows, then inspect the orders table.
Explore how to use the where clause in a select statement to filter fruits by citrus type and a quantity of 20, and to retrieve the unit price of Tangerine.
Master stage 1 of SQL by selecting from a table using a where clause to filter rows by a value.
Explore sql aggregation functions min, max, and avg as you query fruits and workforce tables to compute minimum, maximum, and average quantities and salaries.
Learn how aliases provide temporary names for columns, with minimum, maximum, and average quantities, and compute a total cost (quantity × price) aliased as total cost for orange fruit.
Demonstrates concatenation in sql by joining fruit name and fruit type from the fruits table, creating results like 'orange citrus' and showing how to insert a space as a separator.
Learn how the in operator tests expressions against a list of values, using examples like selecting fruit types in 'citrus' and 'berries' or dates in a workforce table.
Use the between condition in SQL to filter fruits by quantity five to twelve and orders by date between 10 February 2018 and 16 December 2018.
Learn to use sum and subtraction in SQL to total quantities and prices, and generate a citrus fruit quantity report by selecting sum(quantity) from fruits where fruit_type = citrus.
Discover how the round function in SQL rounds numbers to the nearest integer and to specific decimal places, with examples showing rounding to two and three decimal places.
Apply the not equal condition in SQL to filter fruits, selecting name, quantity, and price while excluding melon from the results.
Learn how to use the substring function to extract parts of a string by specifying start and end positions, with examples using words like president and strawberry.
Learn how to use the months_between function to compute months between two dates, such as 12 October 2019 and the current date, using a dummy dual table for demonstration.
Explore how the next_day function finds the first day of the week and the next Monday in SQL, and apply a six-month probation ending on a Monday for workforce.
Compute a six-month probationary period and set its end to the next Monday, then format the date as Monday the 16th of May 2011 using date formatting functions.
Learn how the ampersand operator creates reusable SQL queries by prompting for input values, with examples filtering fruits by type and employees by hire month.
Learn to apply the sql case statement to evaluate fruit quantities and return stock available when quantity is greater than 20, or stock refill otherwise, using the fruits table.
Zara's worksheet
Use a case expression named price benchmark to classify fruit prices: high if price >= 3, normal if price = 1, and low otherwise, then order by price.
Students learn to compute the maximum, minimum, and average price for citrus and melon fruits by querying the fruits table and filtering type in citrus, melon.
Join the fruits table with the others table on fruit_id to filter the other date equals '12 October 2018' and return the dead fruit names.
Combine fruits, orders, and customers tables to fetch each customer's first name, last name, customer id, and the fruit name for orders on 11 February 2018, using joins on the relevant ids.
Build a salary review benchmark in Zara's groceries task 11, extending task 9 and 10, by labeling reviews as all some when >700, good for 600–700, and bad otherwise.
Write a SQL query to show the year employees were employed at Zahra's groceries, selecting first name and last name, converting the date to year, and ordering ascending.
Use a subquery to find employees hired before Bill Lerner, the manager at Zahra's groceries. Retrieve first name, last name, and hire date, optionally order by hire date.
Use a self join on the workforce table to compare dates, selecting colleagues with dates earlier than Bill Luna's, aliasing as a and b and joining on last name.
Write a query to find employees with salaries greater than Bill Lorna's from the workforce table, returning first name, last name, and salary, with Michael Power at 9500.
DOWNLOAD SOLUTIONS ON ZARA GROCERIES
Unlock and connect to the HR schema in an Oracle database using HR credentials, then explore core tables like countries, departments, employees, and jobs.
Select employees from the employee table with salaries between 8000 and 15000, include the salary in currency format, and order results by salary descending with an alias.
Retrieve employees from departments 20 and 50 with their first and last names and salaries, order by salary descending, and format salaries with a dollar sign for presentable reports.
Create a report of the highest, lowest, and average salaries of all employees, and introduce the torture function to present the results more clearly.
Generate a report of the finance department's lowest salary using a subquery to find the minimum salary from employees where department_id matches the finance department.
Generate a report showing the count of employees under each manager using a self join on the employees table, grouping by the manager's last name.
Generate a report showing employee count by department with street address by joining employees to departments on department_id and to locations on location_id, group by department name and street address.
Generate a department IV report showing locations with fewer than ten employees using the in clause, group by locations, and having count less than ten.
Generate a report of departments with fewer than three employees by joining employees to departments on department id, then group by department id and department name with a having clause.
Build SQL query to list employees hired in 2005 with first name, last name, hire date, department name, salary; join employees with departments on department_id and order by hire date.
Explore sql problem scenarios and hr schema tasks, and learn solutions for these challenges in sql practice.
Output task 18's results into a table named benchmark by issuing a create table benchmark statement to store the results in the benchmark table.
Solve a real-world SQL challenge using the HR schema in task 20, exploring scenario-based queries and practical solutions within the 100 SQL problem scenario and solutions series.
Determine the lowest salary under each manager by computing the minimum salary for each manager_id from employees.
Uses a subquery to pull employees with the last name Ben Stein and list those hired before 24 march 2005, including first name, last name, and hire date.
Explore a self-join on the employees table to compare employee and manager hire dates, selecting last names and identifying employees hired before their managers.
Build a self-join sql query to find colleagues in the same department by last name, join employees to departments on department_id, and exclude the queried employee.
Create an index on the employees call column of the benchmark table to speed data retrieval, then compare retrieval times before and after the index.
DOWNLOAD 30 MORE TASKS ON HR
Download job.sql to populate data for the Job selection process task.
This course provides hands-on experience to enable participants to thrive in a working environment that benefits from SQL developer knowledge and skills.
Job scenarios are included to expose students to practical SQL developer experience. These lessons serve to increase confidence and experience to prepare students as an SQL developer.
Divided into several logical segments for easy learning, 100 SQL Problem Scenario and Solutions provides a platform for those who want to understand how to apply SQL to business logic. This course is designed to accelerate your SQL writing skills and shorten the learning curve.
I will continue to enhance this course with the objective being a comprehensive training and learning reference for aspiring SQL developers world-wide.
Thank you for making the decision to take 100 SQL Problem Scenario and Solutions.
What you’ll learn
Deep understanding on how to build and read simple to complex queries
Ability to analyze business logic using queries
Are there any course requirements or prerequisites?
Must have basic understanding of SQL
Be able to understand a select statement
Who this course is for:
Beginner to intermediate SQL developers