0% found this document useful (0 votes)
20 views

SQL_Assignment 3

The document outlines an analysis of the Titanic passengers dataset using advanced MySQL queries to extract insights on demographics and survival rates. It includes objectives such as writing queries for passenger details, creating views and stored procedures, and utilizing window functions for ranking and categorization. Submission guidelines are provided for students to submit their work in SQL script files or Word documents.

Uploaded by

Pranit Vichare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

SQL_Assignment 3

The document outlines an analysis of the Titanic passengers dataset using advanced MySQL queries to extract insights on demographics and survival rates. It includes objectives such as writing queries for passenger details, creating views and stored procedures, and utilizing window functions for ranking and categorization. Submission guidelines are provided for students to submit their work in SQL script files or Word documents.

Uploaded by

Pranit Vichare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Title: Analyzing the Titanic Passengers Dataset Using Advanced MySQL Queries

Problem Statement:

The dataset contains information about passengers on the Titanic, including personal details
such as name, age, class, fare, survival status, and other related data. The goal is to analyze
this data using advanced MySQL features to answer specific business questions and provide
insights on passenger demographics, survival rates, and relationships between various
attributes.

Datasets Used:

Titanic Dataset

Passengers Dataset: Contains columns such as Passenger_No, first_name, last_name,


survived, pclass, sex, age, parch, fare, embarked, deck, embark_town, and alive.

Objective:

The objective is to perform advanced data analysis and reporting on the Titanic passengers
dataset using key MySQL concepts, such as subqueries, views, stored procedures, CTE
(Common Table Expressions), and window functions like LEAD, LAG, RANK, and
DENSE_RANK.

1. Write a query to find the name and age of the oldest passenger who survived.
2. Create a view to display passenger survival status, class, age, and fare.
3. Create a stored procedure to retrieve passengers based on a given age range.
4. Write a query to categorize passengers based on the fare they paid: 'Low', 'Medium', or
'High'.
5. Show each passenger's fare and the fare of the next passenger.
6. Show the age of each passenger and the age of the previous passenger.
7. Write a query to rank passengers based on their fare, displaying rank for each passenger.
8. Write a query to rank passengers based on their fare, ensuring no gaps in rank

9. Assign row numbers to passengers based on the order of their fares.

10. Use a CTE to calculate the average fare and find passengers who paid more than the
average.

Submit Guidelines:
Students can submit in SQL script files or word document

How to ZIP a folder:


● Put all of the documents/sheets you want to compress (or just one) into a new folder.
● Right click on that folder.
● Select the “Compress to ZIP file” option and then click “Compressed (Zipped) folder.”
● A new .ZIP file will be created that contains your document(s

You might also like