This repository contains the solutions for the "Introduction to SQL and Basic Queries" assignment. The task covers essential SQL operations such as retrieving, filtering, sorting, and limiting data in SQL queries.
- Understand how to retrieve specific data from a database.
- Learn how to filter, sort, and limit results in SQL queries.
- Gain experience in retrieving data from multiple tables and applying conditions.
2. Retrieve the orderDate, requiredDate, and status of orders that are 'In Process' from the orders table. Sort the results by orderDate in descending order.
3. Display the firstName, lastName, and email of employees whose job title is 'Sales Rep' and order them in descending order of employeeNumber.
5. Fetch the productName and quantityInStock from the products table. Sort the results by buyPrice in ascending order and limit the output to 5 records.
- Set up a database: Make sure you have a database system set up, such as MySQL or PostgreSQL.
- Load the
answers.sql
file into your SQL editor (e.g., MySQL Workbench, pgAdmin, etc.). - Run the queries: Execute each query to retrieve the specified data.
These queries assume the following table structures in the database:
- payments: Contains payment details like
checkNumber
,paymentDate
, andamount
. - orders: Contains order details like
orderDate
,requiredDate
, andstatus
. - employees: Contains employee details like
firstName
,lastName
,email
, andjobTitle
. - offices: Contains details about the office locations.
- products: Contains details about products like
productName
,quantityInStock
, andbuyPrice
.
- SQL
- MySQL/PostgreSQL
- GitHub for version control
This repository is intended for educational use.
Name | Augusto Mate |
---|---|
mate.augusto.mz@gmail.com | |
GitHub | github.com/Augusto047 |