0% found this document useful (0 votes)
19 views11 pages

Viva Voice Questions Class 12 Ip

The document contains a series of viva voce questions and answers related to a project on inventory management, focusing on its objectives, implementation using Python and MySQL, and various programming concepts. It covers topics such as data structures in Python, the differences between SQL and MySQL, and the significance of data visualization. Additionally, it includes explanations of database management systems, data types, and various Python libraries and functionalities.

Uploaded by

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

Viva Voice Questions Class 12 Ip

The document contains a series of viva voce questions and answers related to a project on inventory management, focusing on its objectives, implementation using Python and MySQL, and various programming concepts. It covers topics such as data structures in Python, the differences between SQL and MySQL, and the significance of data visualization. Additionally, it includes explanations of database management systems, data types, and various Python libraries and functionalities.

Uploaded by

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

CLASS XII IP

VIVA VOCE QUESTIONS

Q.1 Brief introduction to your project?


Inventory management is all about tracking and controlling of business inventory
right from manufacturing, buying to storing and using. It controls the entire flow
of goods from purchasing to sale and ensures that you always have the right
quantities of the right item in the right location at the right time.
Q.2 Objective of project?
 Provide function to manage goods in the store more efficiently.
 Provide searching facility based on various factors.
 Reduce time and cost to control and manage inventory.
 Reduce paperwork.
 Increased accuracy and reliability.
 Increased Data Consistency.
Q.3 How did you make your project?
I made this project using Python and MySQL. I used Python to make Front end
and MySQL for Data Store.
Q.4 discuss about Frontend and Backend of the software in short.
Frontend- basically front end of any software refers to interface of the software
through which user interact with the application. Generally an programming
language or tool is used to make front end.
Backend- backend of any software is refers to data store of the software where all
data resides. Generally a RDBMS is used as backend of any software.
Q.5 Can we use python as Backend and my SQL as Frontend?
No, we cannot use python as back end of any application because it is a
programming language which is used for developing application interface and
logic of the software. Similarly MySQL cannot be used as Front end because it is
responsible for managing data of any program or software.
Q.6 Can we make this project without using MySQL? If no, why?
Yes we can make our project without using MySQL but it won’t be effective as
we will not be able to store data permanently.
Q.7 can we use CSV file or any other software with python to make this
project?
Yes, we can use CSV or any other application as backend with python for our
project.
Q.8 What version of Python and SQL you used ?
Python version: 3.10
MySQL version: 8.0
Q.9 Is there any difference between SQL and MySQL or both are same?
MySQL SQL
It is an application software It is a language
It is database management it has various command which can be used in
system software used to store MySQL to make query to store, retrieve,
and manage data update and delete data in MySQL
SQL can be integrated with any RDBMS like
SQL is integral part of MySQL
MySQL, Oracle etc.
Q.10 Are both MySQL and python free?
Yes both Python and MySQL are free to use. Both are Open Source Software.
Q.11 What is source code?
Source code is basically the code we write using any programming language to
create program and application logic for software.
Q.12 Is Python interpreted language?
Yes, python is interpreted programming language.
Q.13 List any four application of python?
 Web development: Django, Pyramid, Flask, and Bottle for developing web
frameworks
 Game development: PySoy, PyGame
 Artificial Intelligence and Machine language: SciPy, Pandas, Seaborn,
Keras, NumPy,
 Data Visualization: pandas, matplotlib
 Desktop GUI: PyQt, PyGtk, Kivy, Tkinter, WxPython, PyGUI, and PySide
are some of the best Python-based GUI frameworks
Q.14 Why python is popular? (Features of python)
 Dynamic
 Large set of library and community support
 Easy to learn and use
 it can be used in many varieties of environments such as mobile
applications, desktop applications, web development, hardware programming,
and many more.
 Best for cloud computing, AI and Machine Learning
Q.15 What is module?
Python module is simple file with .py extension which contain python code to
perform a task.
Q.16 What is extension of python module?
.py is extension of python module
Q.17 List five python library we can use?
 Pandas  Numpy
 Matplotlib  SciPy
 Tabulate
Q.18 How to import module in python?
import <module> as <module name>
Exp:
import pandas as pd
Q.19 Difference between complier and Interpreter?
Compiler Interpreter
It translate source code into machine code It only scan and produce error in code
It scans all code at once It scan all code line by line
It takes less time for interpretation It take more time for interpretation
it is large in size It is small in size
It checks both syntax and semantic error It only checks syntax error
Q.20 Write Step to write python program?
Start python IDLE -> File -> New -> New Script opens, now type your code ->
Save -> Run -> Run Module
Q.21 Is there any default data types in python?
Ideally there is no default data type in python, but when you input any value in
python variable, it is treated as String.
Q22. What is Python?
Ans. Python is an open source, platform independent, high level and interpreted
language.
Q23. Name two modes of Python.
Ans. Interactive Mode and Script Mode
Q.24 How to connect python with SQL? Write code.
Import pandas as pd
import mysql.connector as sqlt
con = sqlt.connect(host = “localhost”, user = “root”, passwd = “sanjay”, database
= “hospital”)
cursor = con.cursor()
qry=”select * from item;”
df=pd.read_sql(qry,con)
print(df)
Q.25 Which library we use to connect with SQL?
Mysql-connector-python
Q.26 Have you use dataframe in your python program? Than what is it?
Yes, I used dataframe in Python. it is 2D data structure available in PANDAS
library. It is used to manage large and complex data efficiently and also used in
Data visualization.
Q.27 Differentiate between dataframe and Series.
Dataframe Series
It is 2D data structure It is 1D data structure
It is size and value mutable It is size immutable, value mutable
It can store heterogeneous data It stores homogeneous data
Q.28 Why Python PANDAS is important?
 It supports data visualization
 It handles large data efficiently
 More work can be done in less no of code
 It can read data in many formats
 It handles missing and duplicate data very efficiently
Q.29 Can we use pandas directly to python or we need to install it. If yes,
than How to install it?
No we cannot use PANDAS directly in python. To use it first we need to install
by giving following command:
pip install pandas
Q.30 Write program to create series using list.
import pandas as pd
L = [3,6,7,10]
S = pd.Series(L)
print(S)
Q.31 Can we give our own index in series? If yes, How?
Yes we can provide our own index labels to Series as given below:
import pandas as pd
L = [3,6,7,10]
S = pd.Series(L, index = [‘a’,’b’,’c’,’d’])
print(S)
Q.32 For given series’ S’ [1, 2, 4, 6, 8]? Write code to display [2, 4, 6].
print(S[1:4])
Q. 33 Write code to reverse and display series element?
print(S[::-1]
Q.34 For series [4,6,8,10,12] what will be output of S[1:4:2]?
[6,10]
Q.35 If you make series with dictionary than index is created by ____ of
dictionary.
Key
Q.36 How will you display to first 3 value of series?
S.head(3) Or S[:3]
Q.37 Write three features of dataframe?
 Dataframe is 2D data structure
 It can store heterogeneous data
 It is size and value mutable both.
Q.38 For given dataframe ‘df’, write code to display value of a particular
row and column.
Df[‘column label’][‘row label’]
Q.39 What is PANDAS full form?
PANDAS = Panel Data system
Q.40 Differentiate between loc and iloc?
loc iloc
It is label based seletion method It is index based selection method
Both starts and end label are included Like slices end position or index is excluded
when given start:end when given as start:end
Q.41 Give example to make dataframe from using 2D dictionary.
import pandas as pd
D = {‘Toys’:{‘MP’:7000,’UP’:3400,’AP’:7800,’CG’:4100},
‘Books’:{‘MP’:4300,’UP’:3200,’AP’:5600,’CG’:2000},
‘Shoes’:{‘MP’:6000,’UP’:1200,’AP’:3280,’CG’:3000},}
aid = pd.DataFrame(D)
print(‘—-DataFrame—-‘)
print(aid)
Q42 differentiate between count() and len() in python.
Count() method of dataframe is used to count the non-NA entries for each row or
column.
Df.count(axis = 0 or 1)
0 – index
1 – columns
Len() returns total number of rows in a dataframe.
Len(df)
Q.43 How to check database is empty?
Df.empty
Q.44 How to change index of dataframe?
Df.rename(index = {<labels dictionary>}, inplace = True)
OR
Df.rename(index = {‘a’:’1’,’b’:2})
Q.45 If you write Df.iloc[1:3]=20, what will happen?
It will replace values all columns of 2nd and 3rd row with 20.
Q.46 How can we add new column in dataframe?
Df.<column name> = value
OR
Df[‘column name’] = value
Q.47 What method one can use to delete column or row of given dataframe?
For column
Del df[‘column name’]
Or
Df.drop([column label],axis = 1)
For row
Df.drop([row label])
Q.48 Expand CSV.
CSV – Comma Separated Values
Q49. Why CSV is popular to manage records?
 CSV is faster to handle
 CSV is smaller in size
 CSV is easy to generate and import onto a spreadsheet or database
 CSV is human readable and easy to edit manually
 CSV is processed by almost all existing applications
Q.50 Which library is used to make chart in python?
Matplotlib
Q.51 Write code to make bar chart?
import matplotlib.pyplot as plt
clas = [6,7,8,9,10]
strength = [42,44,50,37,48]
plt.bar(clas, strength)
plt.show()
Q.52 Write code to make a line chart.
import matplotlib.pyplot as plt
Week = range(1,5)
temp = [40,42,50,44]
plt.plot(Week, temp)
plt.legend()
plt.show()
Q.53 What is the significance of Data Visualization?
Data visualization refers to graphical representation of information and data using
various visual element like chart, graph and maps etc.
It helps business organization to
 Analyze data
 Understand data trend
 Understand data patterns
 Compare data
And helps in taking decision for their business growth.
Q.54 axis = 0 and axis = 1 refers to:
Axis 0 refers to rows and 1 refers to columns
Q.55 Is PyPlot is library?
No Pyplot is not a library, it’s a module.
Q.56 What is slicing?
 Slicing refers to creating series or dataframe subset by extracting specific
range of values.
 Slicing is done position wise and not the index wise.
 S[start:end:step]
Q57. Write Full Form of IDLE
Ans. Integrated Development Learning Environment
Q58. What do you mean by comments in Python?
Ans. Non executable lines are called Comments. For this we use # symbol.
Q59. What do you mean by data type?
Ans. Data type refers to the type of value used for example integer, float string etc
Q60. Name five primitive data type in python.
Ans. Five primitive data types are : Numbers, String, List, Tuple and Dictionary
Q61. Write the name and purpose of the following operators.
// % **
Ans.
// : Name of Operator is Floor Division . It is used to find the integer part of the
quotient when one number is divided by other
% : Name is Modulus or Remainder Operator . It is used to find the remainder
when one number is divided by other
**:Name is Exponent. It is used to find the power of a number like 2**3 will give
result 8.
Q62. What is the difference between Lists and Tuples?
Ans.
Lists Tuples
List are mutable Not Mutable
Elements enclosed in Square brackets Elements enclosed in parenthesis
Q63. What is string in python?
Ans. Strings are contiguous series of characters enclosed in single or double
quotes. Python doesn’t have any separate data type for characters so they are
represented as a single character string.

SQL
Q1. What is DBMS?
Ans. DBMS stands for Database Management System. It is a software which
help us to manage data effectively and efficiently.
Q2. What is the full form of RDBMS.
Ans. RDBMS stands for Relational Database Management System.
Q3. Give two example of DBMS.
Ans. Two examples of DBMS are : MySQL, Oracle, Microsoft Access etc.
Q4. What is table in DBMS?
Ans. A Table is a collection of data which is organized in the forms of rows
and columns.
Q5. What is record in a table?
Ans. The horizontal line in a table is called record. It is also known as tuple.
Q6. What is field in a table?
Ans. The vertical line in a table is called field. It is also known as attribute.
Q7. What are the advantages of DBMS?
Ans. Advantages of DBMS are:
1. It reduces data redundancy. 3. It help in sharing of data.
2. It reduces data inconsistency.
Q8. Name the three types of relationship that can be formed in RDBMS.
Ans. Three types of relationship are:
1. One-to-One relationship 3. Many-to-Many relationship
2. One-to-Many relationship
Q9. What do you mean by Degree and Cardinality?
Ans. The number of rows in a table is called Cardinality. The number of
columns i a table is called Degree.
Q10. What is Primary Key in a table?
Ans. A field which uniquely identifies each and every record in a table is
called primary key.
Q11. What do you mean by Candidate key?
Ans. Those field which can act as a primary key in a table is called candidate
key.
Q12. What is alternate key in a table?
Ans. Those candidate keys which are not primary key in a table is called
alternate keys.
Q13. Define Foreign Key.
Ans. A foreign key is a field or group of fields which references the primary
key of another table.
Q14. What is referential integrity in DBMS?
Ans. Referential integrity refers to the limitations which ensures the
relationship between tables. In simple words we can say that it refers to the
relationship between tables.
Q15. What is MySQL?
Ans. It is an open source RDBMS.
Q16. What is SQL?
Ans. SQL stands for Structured Query Language. It is used to perform
certain operations on database.
Q17. Expand DML and DDL.
Ans. DML stands for Data Manipulation Language. DDL stands for Data
Definition Language.
Q18. Give two example of DDL commands
Ans. DDL: Create, Alter, Drop
Q19. Give two examples of DML commands.
Ans. DML : Insert, Update, Delete
Q20. Define data type.
Ans. A data type refers to the type of data that a variable can store such as
integer, floating, string, etc.
Q21. Differentiate between Char and Varchar?
Ans.
Char Varchar
It is a fixed length data type It is a variable length data type
It uses static memory location It uses dynamic memory location
It can hold maximum of 255 characters It can hold maximum of 65535 characters
Q22. What is NULL value in MySQL?
Ans. Null Value means that data is missing or unknown.
Q23. What do you mean by comments in MySQL?
Ans. Non executable statements in MySQL are called comment.
Q24. Which symbols are used to give Single line and Multiple line comment in
MySQL?
Ans. For Single line comments we use # or — symbols
For Multiple line comment we use /*——-*/
Q25. Write a command to display all the existing databases in MySQL.
Ans. Show databases;
Q26. Define constraint in MySQL.
Ans. Constraints are referred to rules or limitations that we enforced on the
columns of a table.
Q27. Name any two commonly used constraint.
Ans. Commonly used constraints are :
1. Not Null 3. Primary Key
2. Unique 4. Default
Q28. What is the difference between Unique and Primary Key constraint?
Ans. Primary key will not accept NULL values whereas Unique key can
accept NULL values. A table can have only one primary key whereas there
can be multiple unique key in a table.
Q29. Write a command to display the structure of table “Stock”
Ans. Desc Stock;
Q30. Which constraint ensures that a column can not have a NULL value?
Ans. NOT NULL
Q31. What is the difference between Update and Alter command in MySQL?
Ans. Update command is used to modify the data of the table and Alter
command is used to modify the structure of the table.
Q32. What is the difference between the following queries?
1. Delete from Book;
2. Delete from Book where price > 400;
Ans. The first query will delete all the records from table book while the
second command will delete only those records from table Book whose price
is more than 400.
Q33. Write a command to make Book_id as primary key after creating the table.
Ans. Alter table Book add Primary Key (Book_id);
Q35. Write a command to add a new column “Price” in a table “Book”.
Ans. Alter table Book add Price float(6,2);
Q36. What is the meaning of float(6,2)?
Ans. float(6,2) refers to a decimal number with total 6 digits including 2
decimal places.
Q37. Write a command to delete a column “Price” from table “Book”.
Ans. Alter table Book drop column Price;
Q38. Write a command to rename a column “Price” to “Amount” of table
“Book”.
Ans. Alter table Book change Price Amount float(6,2);
Q39. What is the difference between Delete and Drop command?
Ans. Delete command is used to delete one or more records from the table
while Drop command is used to delete the complete data along with the
structure of the table.
Q40. Write a command to delete the table “Book”.
Ans. Drop table Book;
Q41. Which command is used to remove the database?
Ans. Drop
Q42. Name the command used to fetch data from the table.
Ans. Select Command
Q43. What is the purpose of Order by Clause?
Ans. Order by Clause is used to arrange the data of the table in ascending or
descending order. This clause is used along with Select command.
Q44. What is the output of the following command?
Select 5 + NULL;
Ans. NULL
Q45. Which operator is used for pattern matching?
Ans. Like
Q46. Name two wildcard symbols which are used in MySQL for pattern
matching.
Ans. Underscore ( _ ) and Percentage (%)
Q47. Which wildcard character is used for single character?
Ans. Underscore ( _ )
Q48. Correct the following query
Select * from Book where Price = NULL;
Ans. Select * from Book where Price is NULL;
Q49. By default Order by clause arrange records in _________________ order.
Ans. Ascending
Q50. Which pattern is used along with Like operator to display only those names
which ends with ‘na’?
Ans. “%na

You might also like