12 TH Computer Science - Lesson Wise 1235 Marks
12 TH Computer Science - Lesson Wise 1235 Marks
Unit IV
CHAPTER 13 PYTHON AND CSV FILES
Choose the best answer:-
1. A CSV file is also known as a ….
(A) Flat File (B) 3D File (C) String File (D) Random File
2. The expansion of CRLF is
(A) Control Return and Line Feed (B) Carriage Return and Form Feed
(C) Control Router and Line Feed (D) Carriage Return and Line Feed
3. Which of the following module is provided by Python to do several operations on the
CSV files? (A) py (B) xls (C) csv (D) os
4. Which of the following mode is used when dealing with non-text files like image or
exe files? (A) Text mode (B) Binary mode (C) xls mode (D) csv mode
5. The command used to skip a row in a CSV file is
(A) next() (B) skip() (C) omit() (D) bounce()
6. Which of the following is a string used to terminate lines produced by writer()method
of csv module? (A) Line Terminator (B) Enter key
(C) Form feed (D) Data Terminator
7. What is the output of the following program?
import csv
d=csv.reader(open('c:\PYPRG\ch13\city.csv'))
next(d)
for row in d:
print(row)
if the file called “city.csv” contain the following details chennai,mylapore umbai,andheri
A) chennai,mylapore (B) mumbai,andheri
(C) chennai (D) chennai,mylapore
mumba mumbai,andheri
8. Which of the following creates an object which maps data to a dictionary?
(A) listreader() (B) reader() (C) tuplereader() (D) DicReader ()
9. Making some changes in the data of the existing file or adding more data is called
(A)Editing (B) Appending (C)Modification (D) Alteration
Unit V
CHAPTER 15 DATA MANIPULATION THROUGH SQL
Choose the best answer:-
1. Which of the following is an organized collection of data?
(A) Database (B) DBMS (C) Information (D) Records
2. SQLite falls under which database system?
(A) Flat file database system (B) Relational Database system
(C) Hierarchical database system (D) Object oriented Database system
3. Which of the following is a control structure used to traverse and fetch the records of
the database?
(A) Pointer (B) Key (C) Cursor (D) Insertion point
4. Any changes made in the values of the record should be saved by the command
(A) Save (B) Save As (C) Commit (D) Oblige
5. Which of the following executes the SQL command to perform some action?
(A) Execute() (B) Key() (C) Cursor() (D) run()
6. Which of the following function retrieves the average of a selected column of rows in
a table?
(A) Add() (B) SUM() (C) AVG() (D) AVERAGE()
7. The function that returns the largest value of the selected column is
(A) MAX() (B) LARGE() (C) HIGH() (D) MAXIMUM()
8. Which of the following is called the master table?
(A) sqlite_master (B) sql_master (C) main_master (D) master_main
9. The most commonly used statement in SQL is
(A) cursor (B) select (C) execute (D) commit
10. Which of the following clause avoide the duplicate?
(A) Distinct (B) Remove (C) Where (D) GroupBy
Unit V
CHAPTER 16 DATA VISUALIZATION USING PYPLOT: LINE CHART, PIE
CHART AND BAR CHART
Choose the best answer:-
1. Which is a python package used for 2D graphics?
a. matplotlib.pyplot b. matplotlib.pip
c. matplotlib.numpy d. matplotlib.plt
2. Identify the package manager for Python packages, or modules.
a. Matplotlib b. PIP c. plt.show() d. python package
3. Read the following code: Identify the purpose of this code and choose the right option
from the following.
C:\Users\YourName\AppData\Local\Programs\Python\Python36-32\Scripts>pip –
version
a. Check if PIP is Installed b. Install PIP
c. Download a Package d. Check PIP version
4. Read the following code: Identify the purpose of this code and choose the right option
from the following.
C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip
list
a. List installed packages b. list command
Unit IV
CHAPTER 13 PYTHON AND CSV FILES
Part - II
Answer the following questions (2 Marks)
1. What is CSV File?
2. Mention the two ways to read a CSV file using Python.
3. Mention the default modes of the File.
4. What is use of next() function?
5. How will you sort more than one column from a csv file?Give an example statement.
Unit V
CHAPTER 15 DATA MANIPULATION THROUGH SQL
Part - II
Answer the following questions (2 Marks)
1. Mention the users who uses the Database.
2. Which method is used to connect a database? Give an example.
3. What is the advantage of declaring a column as “INTEGER PRIMARY KEY”
4. Write the command to populate record in a table. Give an example.
5. Which method is used to fetch all rows from the database table?
Unit V
CHAPTER 16 DATA VISUALIZATION USING PYPLOT: LINE CHART, PIE
CHART AND BAR CHART
Part - II
Answer the following questions (2 Marks)
1. Define: Data Visualization.
2. List the general types of data visualization.
3. List the types of Visualizations in Matplotlib.
Chapter 16.indd 332 20-02-2019 15:43:25 333
Unit V
CHAPTER 15 DATA MANIPULATION THROUGH SQL
Part - IV
Answer the following questions (5 Marks)
1. Write in brief about SQLite and the steps used to use it.
2. Write the Python script to display all the records of the following table using
fetchmany()
Icode ItemName Rate
1003 Scanner 10500
1004 Speaker 3000
5. Consider the following table Supplier and item .Write a python script for (i) to (ii)
SUPPLIER
Suppno Name City Icode SuppQty
S001 Prasad Delhi 1008 100
S002 Anu Bangalore 1010 200
S003 Shahid Bangalore 1008 175
S004 Akila Hydrabad 1005 195
S005 Girish Hydrabad 1003 25
S006 Shylaja Chennai 1008 180
S007 Lavanya Mumbai 1005 325
i) Display Name, City and Itemname of suppliers who do not reside in Delhi.
ii) Increment the SuppQty of Akila by 40
Unit V
CHAPTER 16 DATA VISUALIZATION USING PYPLOT: LINE CHART, PIE
CHART AND BAR CHART
Part - IV
Answer the following questions (5 Marks)
1. Explain in detail the types of pyplots using Matplotlib.
2. Explain the various buttons in a matplotlib window.
3. Explain the purpose of the following functions:
a. plt.xlabel
b. plt.ylabel
c. plt.title
d. plt.legend()
e. plt.show()
D. AGILAN M.Sc.,M.Ed.,M.Phil.,
P.G. Asst in Computer Science
Bethel Matric Higher Secondary School,
Ambur
Mobile No: 9585740001