Q1: Explain Excel , how to add the data in excel and
how to visualize data in excel.
What is Excel?
Microsoft Excel is a powerful spreadsheet program used to record, organize, and analyze
data. Its interface is a grid of numbered rows and lettered columns. The intersection of a row
and column is a cell, which can hold text, numbers, or formulas. It's an essential tool in
business for tasks ranging from simple calculations and budgeting to complex data analysis and
financial modeling.
How to Add Data in Excel
1. Open Excel and Select a Cell: Launch Excel to open a new workbook. Click on any cell
(e.g., cell A1) to select it.
2. Type Your Data: Simply start typing your information.
3. Confirm Entry: Press Enter to move to the cell below or Tab to move to the cell on the
right.
4. Organize It: For best results, structure your data like a table. Use the first row for
headers (e.g., "Name," "City," "Sales"), and enter each record in a new row beneath the
appropriate headers.
How to Visualize Data in Excel
1. Select the Data: Click and drag your mouse to highlight the entire data range you want to
include in your chart, including the headers.
2. Go to the Insert Tab: On the top ribbon, click the 'Insert' tab.
3. Choose a Chart Type: In the 'Charts' group, you'll see options like Column, Line, Pie,
and Bar charts. You can also click 'Recommended Charts' to let Excel suggest the best
visual for your data.
4. Insert and Customize: Click the chart you want, and Excel will instantly generate it on
your worksheet. You can then click on the chart to use the 'Chart Design' and 'Format'
tabs to change the title, colors, and labels.
Q2: Explain SQL and how to create and add the data
in sql.
What is SQL?
SQL, which stands for Structured Query Language, is the standard programming language
used to communicate with and manage data in a relational database. Think of a database as a
highly organized library of information, stored in tables. SQL is the language you use to ask that
library to perform tasks like retrieving, adding, updating, or deleting data. It's a fundamental skill
for data analysts and developers.
How to Create a Table in SQL
columns using the CREATE TABLE command. 👨💻
Before you can add data, you need a table to store it. You define the table's name and its
Example: Here’s how to create a simple table for student information.
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50),
City VARCHAR(100),
EnrollmentDate DATE
);
● CREATE TABLE Students: Creates a table named Students.
● StudentID INT PRIMARY KEY: Creates a column for a unique numeric ID.
● FirstName VARCHAR(50) NOT NULL: Creates a text column for the first name that
cannot be empty.
● EnrollmentDate DATE: Creates a column to store a date.
How to Add Data in SQL
Once the table exists, you add rows of data using the INSERT INTO command.
Example: This command adds two students to the Students table.
INSERT INTO Students (StudentID, FirstName, LastName, City,
EnrollmentDate)
VALUES
(101, 'Aarav', 'Patel', 'Mumbai', '2025-07-15'),
(102, 'Diya', 'Mehta', 'Delhi', '2025-07-16');
● INSERT INTO Students (...): Specifies the table and the columns you're adding data to.
● VALUES (...): Provides the actual data for each row, matching the order of the columns
listed.
Q3: Explain how to get the structured data using
transformation and cleaning method.
You get structured data by taking raw, messy information and putting it through a process of
🍳
data cleaning and data transformation. The goal is to turn unreliable data into a clean,
organized table with neat rows and columns that you can trust for analysis.
1. Data Cleaning
This is the process of fixing or removing errors and inconsistencies.
● Handle Missing Data: You can either remove rows with missing values or fill them in (a
process called imputation) using the column's mean, median, or mode.
● Correct Errors: Fix typos and structural mistakes (e.g., "New Yrok" to "New York").
● Standardize Data: Make sure all data is consistent. This includes converting text to the
same case (e.g., all lowercase), using a single date format (YYYY-MM-DD), and trimming
extra whitespace.
● Remove Duplicates: Delete any rows that are exact copies of each other to avoid
skewing your analysis.
2. Data Transformation
This is the process of converting data from one format or structure to another to make it more
useful.
● Data Type Conversion: Ensure each column has the correct data type (e.g., converting
text like "100" into a number 100).
● Feature Engineering: Create new, more insightful columns from existing data. For
example, creating an 'Age' column from a 'Date of Birth' column.
● Aggregation: Summarize data to a higher level. For example, you could transform daily
sales data into a new table showing total monthly sales.
Q4: Explain which python libraries are used to read
the data .
Several Python libraries are used to read data, but the
most essential and widely used is Pandas. The choice of
library often depends on the type and size of the data file.
Pandas
Pandas is the go-to library for data analysis in Python and offers powerful, flexible functions to
read data from a wide variety of sources. It reads data into a highly optimized, two-dimensional
table-like structure called a DataFrame, which is perfect for cleaning, transforming, and
analyzing data.
Common Pandas functions for reading data include:
● pd.read_csv(): Reads data from Comma-Separated Values (.csv) files.
● pd.read_excel(): Reads data from Microsoft Excel files (.xls, .xlsx).
● pd.read_sql(): Reads data from a SQL database by executing a query.
NumPy
While primarily a library for numerical computation, NumPy can also be used to read simple,
numerical data from text files (.txt, .csv) into its core data structure, the NumPy array, using
functions like np.loadtxt().
Built-in csv Module
Python has a built-in module for handling CSV files without needing to install any external
libraries. The csv.reader() function reads a CSV file row by row and is suitable for simple,
iterative processing.
Q5: Explain which techniques are used for visualizing
the data using python libraries.
Python uses powerful libraries like Matplotlib, Seaborn,
and Plotly to create a wide range of data visualizations.
The technique you choose depends on what you want to
show.
● Comparing Values and Categories: Use Bar Charts to compare quantities across
different groups. (seaborn.barplot())
● Showing Distributions of Data: Use Histograms to see the frequency distribution of a
single variable and Box Plots to summarize its spread, including median and outliers.
(seaborn.histplot(), seaborn.boxplot())
● Exploring Relationships Between Variables: Use Scatter Plots to visualize the
relationship between two continuous variables and Heatmaps to visualize matrix data,
like correlations. (seaborn.scatterplot(), seaborn.heatmap())
● Tracking Trends Over Time: Use Line Charts to show a trend in data over a continuous
interval, such as time. (seaborn.lineplot())
● Interactive Visualizations: For creating dynamic charts that users can hover over, zoom,
and pan, Plotly is the leading library.
Q6: Write the sql query for update and delete the data
using sql.How to Update Data Using SQL
The UPDATE statement is used to modify existing records in a table. The WHERE clause is
critical to specify which record(s) to change, otherwise you will update every row in the table.
Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2
WHERE condition;
Example: To change the department and salary for an employee with ID 102.
UPDATE Employees
SET Department = 'Digital Marketing', Salary = 80000
WHERE EmployeeID = 102;
How to Delete Data Using SQL
The DELETE statement is used to remove existing records from a table. Again, the WHERE
clause is essential. If you omit it, you will delete all data from your table.
Syntax:
DELETE FROM table_name
WHERE condition;
Example: To remove the employee with ID 103 from the table.
DELETE FROM Employees
WHERE EmployeeID = 103;