Questions For Preparation
Questions For Preparation
Q1: SQL Query for Joining Two Tables Using Inner Join
Syntax:
```sql
FROM table1 a
ON a.common_column = b.common_column;
```
Q2: Display Records Present in One Table but Not in Another Using Left Join
Syntax:
```sql
SELECT a.
FROM table1 a
ON a.common_column = b.common_column
```
Q3: Display Students Who Scored Above the Class Average (Using Partition By)
Table Structure:
SQL Query:
```sql
FROM (
FROM students
) AS subquery
```
SELECT
PRODUCT,
SUM(CASE WHEN YEAR = 2021 THEN SALES ELSE 0 END) AS [2021 SALES],
SUM(CASE WHEN YEAR = 2022 THEN SALES ELSE 0 END) AS [2022 SALES]
FROM
SALES
GROUP BY
PRODUCT;
Q9. Explain the record return with left outer join, right outer join, inner join and full outer join:
Table 1 Table 2
COL1 COL1
NULL 1
1 1
1 1
NULL
Pandas Questions
Example in Pandas:
```python
import pandas as pd
df = pd.DataFrame({
})
print(df)
```
```python
df.describe()
```
This function provides summary statistics like mean, median, standard deviation, etc.
Q12: Mention all the essential steps used in EDA (Exploratory Data Analysis)? Such as Null value imputation, outlier
handling, Data types and conversions.
Q13. Find average sales for each department for each month, then present rows into columns:
Tableau
VIP customers.
3. Order of Conversion:
Python Code:
```python
print(classification)
```
SQL Query:
```sql
FROM cities
```
```sql
FROM sales
```
Without Window Function:
```sql
FROM sales a
WHERE 5 > (
FROM sales b
);
```
```sql
AVG(sale) OVER (PARTITION BY department ORDER BY sale_date ROWS BETWEEN 2 PRECEDING AND CURRENT
ROW) AS moving_avg
FROM sales;
```
Project Explanation
2. Joins in Python:
1. Date Operations:
Subtracting dates and finding customers who closed accounts within 15 days.
Plane Seat Puzzle: How many bowls can fit in a plane seat?
Horse Race Puzzle: 25 horses, 5 can race at a time. How many races are needed to find the top 3 fastest horses?
Query for students with their highestscoring subject(s), considering cases with equal max scores.
2. Advanced Problem:
Machine Learning
3. Data Preparation:
General Questions
1. Pressure Handling:
2. Project Explanation: