Skip to main content
Chapter 5 of 8
~18 min read
Last reviewed July 17, 2026

Data Science

The Data Science Life Cycle (DSLC), how Bar, Pie, and Line charts compare, the difference between DBMS and SQL, and writing SQL queries.

Written and reviewed by the IK Learning team

  • DSLC Steps
  • Bar / Pie / Line Charts
  • DBMS vs SQL
  • SQL Queries
  • Data Visualization
  • Data Collection

This chapter covers the Data Science Life Cycle from understanding a problem through to communicating results, comparing bar, pie, and line charts for visualizing data, and explaining the difference between a DBMS and SQL along with how to write basic SQL queries.

Chapter Introduction

What this chapter is about, and why it matters

Class 9 introduced data and how to collect it. This chapter turns that into a repeatable professional process — the Data Science Life Cycle — and then goes deeper into the two tools that do the work: visualisation and SQL.

The most examinable idea is that the life cycle starts with a question, not with data. Teams that collect data first and look for a question afterwards produce impressive-looking analysis that answers nothing anybody asked. Defining the problem is step one for a reason.

SQL rewards practice more than reading. Write out five queries by hand against an imaginary students table and the keyword order stops being something you have to recall.

What You Will Learn

The skills this chapter is assessed on

  • List the stages of the Data Science Life Cycle in order and explain the purpose of each.
  • Select and justify an appropriate chart for a given data set.
  • Explain the difference between a database, a DBMS and SQL.
  • Write SQL queries using SELECT, FROM, WHERE, ORDER BY and simple aggregate functions.
  • Explain why data cleaning takes the largest share of a data science project.

Key Concepts Explained

8 core ideas — each with its definition and a separate worked example

Data Science Life Cycle (DSLC)

Definition

The Data Science Life Cycle is the structured sequence of stages followed in a data science project: understanding and defining the problem, collecting data, cleaning and preparing it, exploring and analysing it, modelling or interpreting the results, and finally communicating the findings.

Example

A school wants to reduce absenteeism. Define: which year groups are most affected and when? Collect: two years of attendance records. Clean: remove duplicate entries and fix inconsistent date formats. Analyse: compare absence by month and year group. Interpret: absence peaks in one month for one group. Communicate: a single clear chart presented to the staff meeting.

Detailed Explanation

The cycle is iterative, not a straight line. Analysis frequently reveals that the wrong data was collected, sending the team back a stage. Describing it as a strict one-way process is a common exam inaccuracy.

Data cleaning

Definition

Data cleaning is the stage of preparing collected data for analysis by correcting errors, removing duplicates, handling missing values and making formats consistent.

Example

One attendance file records dates as 05/03/2026 and another as 3 May 2026. A third has blank cells where a teacher forgot to mark the register. Cleaning makes every date the same format and decides — explicitly — what a blank means.

Detailed Explanation

This stage usually consumes the largest share of a real project, which surprises students who expect analysis to dominate. The reason is simple: an analysis run on inconsistent data produces a confident, precise, wrong answer.

Bar chart

Definition

A bar chart uses rectangular bars of proportional length to compare a measured value across separate, distinct categories.

Example

Comparing the number of students who chose each optional subject — one bar per subject. The categories have no natural order, and the eye compares bar heights easily.

Line graph

Definition

A line graph plots data points connected by a line to show how a value changes over a continuous scale, most often time.

Example

Plotting a class's average score across the twelve monthly tests of a year. The connecting line makes the trend — rising, falling or flat — visible instantly.

Detailed Explanation

The connecting line implies continuity between points, so a line graph is wrong for unrelated categories. A line joining "Maths" to "English" suggests a progression that does not exist.

Pie chart

Definition

A pie chart is a circular chart divided into sectors, where each sector's size represents that category's proportion of a single whole.

Example

Showing that 40% of a class chose Computer Science, 35% chose Biology and 25% chose Arts. The three slices together account for the entire class — which is what makes the chart valid.

Detailed Explanation

Two conditions must hold: the parts must sum to a meaningful whole, and there should be few enough slices to distinguish. Beyond about six categories a bar chart communicates better, because comparing angles is harder for the eye than comparing lengths.

DBMS versus SQL

Definition

A DBMS (Database Management System) is the software that stores, organises, secures and manages access to a database. SQL is the standard language used to instruct a relational DBMS to store or retrieve data.

Example

MySQL is a DBMS — a program that runs and holds your data. `SELECT * FROM students;` is SQL — a sentence you write and give to that program. The DBMS is the machine; SQL is the instruction.

Detailed Explanation

A useful comparison: the DBMS is a library building with its cataloguing system and staff; SQL is the request slip you fill in. Different DBMS products understand broadly the same SQL, which is why the language transfers between systems.

The SELECT query

Definition

SELECT is the SQL statement used to retrieve data from one or more tables, specifying which columns to return, which table to read, which rows to include and how to order the results.

Example

Retrieving the top scorers from a students table:

SELECT name, marks
FROM students
WHERE marks > 80
ORDER BY marks DESC;

Detailed Explanation

The clause order is fixed and cannot be rearranged: SELECT, FROM, WHERE, ORDER BY. Reading it aloud as "select these columns, from this table, where this is true, ordered by this" makes the order memorable.

Aggregate functions

Definition

Aggregate functions in SQL perform a calculation across a set of rows and return a single summary value; the common ones are COUNT, SUM, AVG, MIN and MAX.

Example

Summarising a whole table in one query:

SELECT COUNT(*) AS total_students,
       AVG(marks)  AS average_mark,
       MAX(marks)  AS highest_mark
FROM students;

Detailed Explanation

Aggregates collapse many rows into one answer, which is why you cannot normally mix them with ordinary columns unless you also group the data. For Class 10 level, use them on their own and the query stays valid.

Step-by-Step Worked Examples

How to lay the answer out so method marks are earned

Writing a query to answer a stated question

Question: A table named students holds columns name, class, marks and city. Write a query listing the names and marks of Class 10 students from Lahore who scored at least 60, with the highest scorer first.

  1. Decide which columns the answer needs: name and marks. Those go after SELECT.
  2. Identify the table: students. That goes after FROM.
  3. Translate each restriction into a condition: class = 10, city = 'Lahore', marks >= 60.
  4. Join the conditions with AND, because all three must hold at once.
  5. Put text values in single quotes; numbers do not need them.
  6. Add ORDER BY marks DESC to place the highest first, and end with a semicolon.

Answer

SELECT name, marks FROM students WHERE class = 10 AND city = 'Lahore' AND marks >= 60 ORDER BY marks DESC; Note 'at least 60' means >= 60, not > 60. Reading the wording precisely is half of every SQL question.

Where This Is Used in Real Life

The same ideas, outside the syllabus

Data science behind a delivery app

Estimated arrival times come from analysing historical delivery data by area, time of day and weather. The whole life cycle runs continuously: collect, clean, analyse, communicate the estimate to you as a single number.

Spotting a misleading chart

Check three things before believing any graph: does the vertical axis start at zero, are the categories comparable, and do pie slices sum to 100%? Each of these is a documented way to mislead honestly-collected data.

SQL as a career skill

SQL is used by analysts, accountants, marketers and managers, not only programmers. It is one of the highest-value single skills in this course precisely because it is useful outside software development.

Common Mistakes to Avoid

Errors that cost marks in this chapter, and the correction for each

Mistake

Starting a data science project by collecting data.

Correct Approach

The first stage is defining the problem. Data collected without a question rarely answers one.

Mistake

Using a pie chart for data that does not form a whole.

Correct Approach

Pie charts show parts of one total. Comparing separate quantities needs a bar chart.

Mistake

Writing SQL clauses out of order.

Correct Approach

SELECT → FROM → WHERE → ORDER BY. The order is part of the syntax and cannot be varied.

Mistake

Omitting quotation marks around text values in a WHERE clause.

Correct Approach

Text needs single quotes: city = 'Lahore'. Numbers do not: marks >= 60.

Mistake

Treating "at least" as a strict greater-than.

Correct Approach

"At least 60" is >= 60. "More than 60" is > 60. One student on exactly 60 is the difference.

Mistake

Assuming data cleaning is a minor step.

Correct Approach

It normally takes the largest share of the work, and skipping it invalidates everything that follows.

Exam Preparation Tips

Technique specific to this chapter

  • Learn the DSLC stages in order and be ready to give one sentence on each. Questions frequently ask for the purpose, not just the name.
  • When choosing a chart, always state the reason. "Line graph, because the data shows change over time" is the complete answer.
  • Write SQL keywords in capitals and put each clause on its own line. It is easier to mark and easier to check.
  • Underline the conditions in a worded SQL question before writing anything — each one becomes part of the WHERE clause.
  • For DBMS versus SQL, remember: one is software, the other is a language. State that contrast explicitly.

Quick Revision Summary

The whole chapter in one screen — read this the night before

  • DSLC: define problem → collect → clean → analyse → interpret/model → communicate.
  • The cycle is iterative; analysis can send you back to collection.
  • Data cleaning takes the largest share of a real project.
  • Bar = compare categories. Line = change over time. Pie = parts of one whole.
  • DBMS = the software. SQL = the language. Database = the stored data.
  • Query order: SELECT → FROM → WHERE → ORDER BY, ending in a semicolon.
  • ASC = ascending (default), DESC = descending.
  • Aggregates: COUNT, SUM, AVG, MIN, MAX.
  • Text in conditions needs single quotes; numbers do not.

Glossary of Terms

Words used in this chapter, defined plainly

Table
A structure of rows and columns holding related data in a database.
Row (record)
One complete entry in a table.
Column (field)
One attribute stored for every record in a table.
Primary key
A column whose value uniquely identifies each row.
Query
An instruction requesting specific data from a database.
Clause
One part of an SQL statement, such as WHERE or ORDER BY.
Outlier
A value far outside the normal range, which may be an error or a genuine extreme.

Practice Questions

Now test yourself on the concepts above. Collapse the answers to make it a real practice run.

Multiple Choice Questions with Explanations

10 MCQs — pick an option to check yourself, then read why the answer is right

1What comes first in the Data Science Life Cycle (DSLC)?

Correct answer: CUnderstanding the Problem

The Data Science Life Cycle begins with understanding the problem so the right data and methods can be chosen.

2Which method works best for gathering opinions from many students?

Correct answer: BSurvey

A survey is the most effective way to collect opinions from a large number of people through a set of questions.

3What does "bias" mean in data?

Correct answer: BUnfair or one-sided data

Bias means the data is unfair or one-sided, which can lead to inaccurate conclusions.

4Which tool suits beginners best for creating charts?

Correct answer: CGoogle Sheets

Google Sheets is beginner-friendly and lets users create charts easily without special skills.

5A relational database organizes information in the form of:

Correct answer: BTables

A relational database stores information in tables made up of rows and columns.

6Which chart works best for comparing groups?

Correct answer: BBar Chart

A bar chart is best for comparing values across different groups or categories.

7What is the main aim of analyzing data?

Correct answer: CFind patterns and make decisions

The purpose of data analysis is to find patterns and insights that support better decisions.

8Which of these tools is an advanced data visualization platform?

Correct answer: BGoogle Data Studio

Google Data Studio is an advanced platform for building interactive data visualizations and dashboards.

9What should happen before data is stored?

Correct answer: BClean and validate it

Data should be cleaned and validated before storage to remove errors and ensure accuracy.

10Which of these is an example of a data source?

Correct answer: BSurvey form

A survey form collects information directly from people, making it a genuine data source.

Short Questions with Answers

8 short-answer questions

Understanding the problem is the first step of the Data Science Life Cycle, in which the exact question to be solved is defined. It matters because it clarifies what data is actually needed, keeps the data relevant, and avoids unnecessary collection. Example: Before studying why students reach school late, you must first decide whether to collect their arrival times or their transport details.
Data collection is the step in which the information needed to solve a problem is gathered. Two common methods are survey, in which people are asked questions, and observation, in which behaviour is watched and recorded. Example: Survey — gathering opinions from students using a Google Form; Observation — watching how students spend their free time.
Cleaning data means spotting and correcting the errors within collected data, such as spelling mistakes, missing values, and inconsistent formatting, so that the analysis is accurate. Example: Changing a misspelled city name "Lahre" to "Lahore" and filling a blank age cell with the correct value.
Validating data is the process of confirming that data is accurate, complete, and reliable before it is used. It matters because incorrect or inconsistent data leads to faulty conclusions. Example: Rejecting a survey entry in which a student age is recorded as 150 years.
Data visualization is the presentation of data in the form of charts and graphs so that information is clear and patterns or trends can be understood at a glance. Example: A bar chart of monthly sales instantly shows which month had the highest sales.
Bias in data means the data is unfair or one-sided and does not represent the whole group, so decisions based on it can be incorrect or misleading. Removing bias keeps the results accurate and fair. Example: Surveying only the boys about a school activity gives biased results, because the opinions of the girls are missing.
Cleaning a messy survey means correcting its errors before analysis. Two steps are to correct spelling errors and keep the formatting consistent across all responses, and to fill in missing values logically and fairly. Example: Writing every city name as "Karachi" instead of "karachi" or "Krachi", and filling a blank marks column with the class average.
Charting tools are software programs used to turn raw data into charts and graphs. Two commonly used tools are Google Sheets and Microsoft Excel. Example: Selecting a column of marks in Microsoft Excel and choosing Insert → Chart creates a bar chart of those marks.

Long Questions with Detailed Answers

4 in-depth answers

Six Steps of DSLC 1. Understanding the Problem: Pin down the question or problem that needs solving 2. Collecting Data: Gather relevant data from surveys, sensors, databases, or other sources. 3. Cleaning Data: Fix errors, fill in missing values, and make the data consistent. 4. Analyzing Data: Examine and process the data to uncover patterns, trends, or insights. 5. Visualizing Data: Present the data through charts, graphs, or dashboards for easy understanding. 6. Communicating Results: Share findings through reports, presentations, or visuals to support decision-making.
Chart Type | Use / Purpose | Example | Key Features Bar Chart | Compare groups or categories | Number of students who like Cricket, | Vertical or horizontal bars; easy to | | Football, Hockey | compare quantities between categories Pie Chart | Show parts of a whole (percentage | Percentage of students' favorite snacks | Circular chart; each slice represents a | or proportion) | | part of the total; good for proportions Line Chart | Show changes over time or trends | Number of students arriving late each week | Points connected with lines; shows trend | | | or growth; useful for time-series data
Feature | DBMS (Database Management System) | SQL (Structured Query Language) Definition | Software used to create, manage, and interact | Language used to interact with databases to | with databases | retrieve, add, update, or delete data Purpose | Organizes and stores data efficiently | Carries out operations on data held in a database Examples | MySQL, SQLite, Microsoft Access | SELECT, INSERT, UPDATE, DELETE Functionality | Manages storage, indexing, and security | Queries and manipulates data Type | Software | Language
SELECT* FROM student WHERE roll_number = 15; Explanation 1. SELECT * retrieves every column of data. 2. FROM student specifies the table. 3. WHERE roll_number = 15 filters for the row with roll number 15. Student Table: roll_number | Name 12 | Faisal Zia 15 | Khalid 18 | Umaiama Result: roll_number | Name 15 | Khalid

Important Questions for Revision

4 high-priority questions

1. Understanding the Problem: Pin down the question or problem that needs to be solved using data. 2. Collecting Data: Gather relevant data from surveys, sensors, databases, or online sources. 3. Cleaning Data: Fix errors, fill in missing values, and make the data consistent and reliable. 4. Analyzing Data: Examine and process data to uncover patterns, trends, or insights. 5. Interpreting Data (Visualizing): Present data through charts and graphs for easy understanding. 6. Communicating Results: Share findings through reports or presentations to support decision-making.
Bar Chart: 1. Used for: Comparing different groups or categories 2. Example: Number of students who like each sport (Cricket: 10, Football: 5) 3. X-axis shows categories, Y-axis shows values Pie Chart: 1. Used for: Showing parts of a whole (percentages) 2. Example: Percentage of students preferring different snacks 3. Displayed as slices of a circle Line Chart: 1. Used for: Showing changes or trends over time 2. Example: Number of students arriving late each week 3. Points connected by lines to show the direction of change
DBMS (Database Management System): 1. Software used to create, manage, and interact with databases 2. Examples: MySQL, SQLite, Microsoft Access 3. Handles storage, indexing, and security of data SQL (Structured Query Language): 1. A language used to communicate with a database 2. Used to add, update, delete, or retrieve data 3. Basic commands: SELECT, INSERT, UPDATE, DELETE Key difference: DBMS is the software (the tool), while SQL is the language used to work with that tool.
Understanding the problem is the first and most important step in Data Science. Without clearly defining the problem: - We may collect the wrong data (irrelevant or useless data) - Analysis will produce incorrect or misleading results - Time and resources will be wasted By understanding the problem, we know what questions to ask, what data to collect, and what results to look for. Clear objectives guide the entire data science process.

Frequently Asked Questions

6 quick answers to common questions about this chapter

A DBMS (like MySQL) is the actual software used to create, store, and manage a database. SQL is the language used to communicate with that database — to retrieve, add, update, or delete data. The DBMS is the tool; SQL is the language you use to operate that tool.
A line chart is generally better for trends over time, since connected points make it easy to see whether values are rising, falling, or staying steady across a period. A bar chart is better suited for comparing separate categories against each other at a single point in time.
A school wanting to reduce late arrivals might: understand the problem (why are students late?), collect data (attendance logs), clean it (fix incorrect entries), analyze it (find which days see the most lateness), visualize it (a chart by day), and communicate results (a report to the principal) — the full six-step DSLC in action.
If you collect data before knowing exactly what question you're trying to answer, you risk gathering the wrong information entirely, wasting time and resources. Clearly defining the problem first ensures every later step — collection, cleaning, analysis — is actually aimed at answering the right question.
Yes. The Data Science Life Cycle, bar/pie/line charts, DBMS vs SQL, and writing basic SQL queries are all part of the Class 10 syllabus and are examined through MCQs and short/long answer questions.
A simple SQL query uses SELECT to choose columns, FROM to name the table, and WHERE to filter for a specific condition — for example, SELECT * FROM student WHERE roll_number = 15; retrieves every column for just the student whose roll number is 15.

Chapter Test

10 questions with the answers hidden — check what you actually remember

You have just read the explanations above. This checks whether they stuck. The answers stay hidden until you finish, so it is closer to exam conditions than scrolling through the notes again.

  • 10 questions, one at a time — no time limit.
  • You can move back and change an answer before submitting.
  • Afterwards you get your score, every explanation, and what to re-read.

Your score is saved in this browser only. No account, nothing sent anywhere.

Related Topics in the Other Class