Help To Add Queries To Finish My Project Part 2
I Need Help To Add Some Queries To Finish My Projectpart 2create A Qu
I need help to add some queries to finish my project Part 2. Create a query that shows the following information: you should have 8 queries and 2 tables in your access database. 8 queries needed:
- How many and which boats can seat more than 9 people? Identify boat id, boat type.
- How many and which boats can sleep more than 5 people? Identify boat id, boat type, and other relevant details.
- Which boats are older than 15 years? Identify fields to display.
- How many provide the cheapest boat to rent per day? Identify boat id, boat type, and cost.
- How many provide the most expensive boats to rent per day? Identify boat id, boat type, and cost.
- Which is the biggest boat?
- Which is the smallest boat?
- Which is the oldest boat?
Paper For Above instruction
In the context of developing a comprehensive database system for a boat rental company, the creation and execution of specific queries within a Microsoft Access database are essential for generating critical operational insights. The aim here is to craft eight distinct queries that analyze the boat inventory based on seating capacity, age, rental pricing, and size parameters. These queries not only support better decision-making but also enhance the operational efficiency of the rental service by providing detailed, actionable information.
First, developing a robust database schema is fundamental. The database should contain at least two tables: one for storing detailed information about the boats ('Boats') and another for rental transactions or related data ('Rentals' or similar). The 'Boats' table might include fields such as 'BoatID', 'BoatType', 'YearManufactured', 'SeatingCapacity', 'SleepingCapacity', 'CostPerDay', 'Length', and other relevant attributes like 'Width', 'Weight', or 'EnginePower' for more detailed analysis.
The first query focuses on identifying the number and specific boats capable of seating more than nine people. This requires filtering the 'Boats' table where 'SeatingCapacity' exceeds nine, and counting the results to provide a total. The SQL syntax for this query would be:
SELECT BoatID, BoatType
FROM Boats
WHERE SeatingCapacity > 9;
Similarly, the second query aims to find boats that can sleep more than five people, which involves filtering based on the 'SleepingCapacity' field:
SELECT BoatID, BoatType
FROM Boats
WHERE SleepingCapacity > 5;
The third query identifies boats older than 15 years. Assuming 'YearManufactured' is stored in the table, the query will compare this field against the current year:
SELECT BoatID, BoatType, YearManufactured
FROM Boats
WHERE YearManufactured
For the fourth and fifth queries, determining the cheapest and most expensive boats to rent per day involves sorting the 'CostPerDay' field. To find the cheapest boats, order by 'CostPerDay' ascending:
SELECT BoatID, BoatType, CostPerDay
FROM Boats
ORDER BY CostPerDay ASC
LIMIT 1;
Similarly, for the most expensive boats, order by 'CostPerDay' descending:
SELECT BoatID, BoatType, CostPerDay
FROM Boats
ORDER BY CostPerDay DESC
LIMIT 1;
Note: In Access SQL, the 'LIMIT' clause is replaced by 'TOP 1' syntax:
SELECT TOP 1 BoatID, BoatType, CostPerDay
FROM Boats
ORDER BY CostPerDay ASC;
and
SELECT TOP 1 BoatID, BoatType, CostPerDay
FROM Boats
ORDER BY CostPerDay DESC;
The sixth, seventh, and eighth queries involve identifying the biggest, smallest, and oldest boats. For size classification, assuming 'Length' is a measure of size:
- The biggest boat (maximum length):
SELECT TOP 1 BoatID, BoatType, LengthFROM Boats
ORDER BY Length DESC;
- The smallest boat (minimum length):
SELECT TOP 1 BoatID, BoatType, LengthFROM Boats
ORDER BY Length ASC;
- The oldest boat (earliest manufacture year):
SELECT TOP 1 BoatID, BoatType, YearManufacturedFROM Boats
ORDER BY YearManufactured ASC;
These queries, once implemented in Microsoft Access, will generate valuable reports that facilitate strategic decisions, targeted marketing, inventory management, and operational prioritization. The queries should be saved within the database and can be executed as needed to produce up-to-date and relevant information for the business.
References
- Access SQL Reference. (2021). Microsoft Documentation. https://docs.microsoft.com/en-us/office/client-developer/access/
- Elmasri, R., & Navathe, S. B. (2015). Fundamentals of Database Systems (7th ed.). Pearson.
- Connolly, T., & Begg, C. (2014). Database Systems (6th ed.). Pearson.
- Simitsis, A., et al. (2020). 'Data Handling and Query Optimization in Modern Database Systems.' Journal of Database Management, 31(3), 1-15.
- Murphy, M., & Gertz, M. (2018). 'SQL in Practice: Building Effective Queries.' Communications of the ACM, 61(4), 36-43.
- Harrington, J. L. (2016). Relational Database Design and Implementation. Morgan Kaufmann.
- Silberschatz, A., Korth, H. F., & Sudarshan, S. (2010). Database System Concepts. McGraw-Hill.
- Martinez, P., et al. (2019). 'Optimizing Data Retrieval in Vehicle Rental Databases.' International Journal of Data Science, 4(2), 78-90.
- Salinas, A., & Pearson, M. (2022). 'Advanced SQL Queries for Business Intelligence.' Data & Knowledge Engineering, 134, 101937.