Course: 303: Datal}ase handling using Python
Course Code 303
Course Title Database Handling using Python
Crt,dit 4
C()urse CatiJEory Major Course
I.evil[ til` Course 300 -399 ( Hii!her Level )
Tcziching ptir Week 4 Hrs (3 Hours Theory + 2 Hours Lab.work)
Minimum weeks/Semester I 5 (Including Class work, examination, preparation etc.)
Review / Revision 2023-2024
lmplenientation Year A.Y.2024-2025
Medium ol. Instruction English
Purpose of Coui.s.I - The course is aimed to give knowledge about use ofsQLite and
hand le the dataset using Python. Basic purpose of this course to
impart know ledge about database handling, dumping and converting
to csv and text file using Python.
- lt also aims to understand connecting dataset with python and
execute queries using Python.
Course ()bjecti`re As an outcome of the subject, it is expected that the students will gain
conceptual and practical knowledge aboiit handling database, dump the
database, restore database, database interaction with python, important
pythoti libraries, and perform basic statistical analysis and basic Data
Visualization.
P[.e-re(iuisite -SQLite Installation, setup and configuration sliould be shown practically
as part of the preparation.
-DDL-Create, Alter, Drop table, Rename, Column. Vacuum
-DML-Insert, Update ,Delete, Replace
-Constraints : Keys ( Primary, Unique, Foreign), Null,
Check Constra int
-Views (Crcatc and Drop).
Course Out come Col : To make students understand working with SQLite.
C02: To make students understand various components of database like
Triggers.
C03: To make students understand handling database and dumping the
database to csv and text flle as well as converting csv and text files to
database.
C04: To make students understand the importance of library functions to
connect python with SQLite and handle the database using python.
COS: To handle csv and excel files using python and use various
statistica I analysis using Numpy and Pandas library.
C06: To make student understand and learn matplotlib functions to
perform basic visualiza lion of data.
Mz`pping betweenCourseOutcomes(CO)``-ithProgramSpecificOut.`omes(PSO) Psol PS02 PS03 PS04 PS05 PS06 PS07 PSO8
Col
C02
C03
C04 \``1
COS
16 I P a g e
Course Content Unit-1: Introduction to SQLite:
I. I SQLjte advantages, features and Fundamentals:
1.I.I SQLite datatype : ( Dynanic type, SQLite manifest typing &
type affinity) (NULL, INTEGER, REAL, TEXT, BLOB)
I.I.2 Transaction, Rollback, Commit
I .2 Data Filtering and Triggers
I.2. I Filtering: Distinct, where, between. in, like, Union, intersect,
Except, Limit, IS NULL
I.2.2 Having, Group by, Order by, Conditional Logic (CASE)
I.3 SQLite joins: Inner, left, cross, self, Full outerjoins.
I .4 SQLite Trigger:
I.4.I Concepts of Trigger, Before and After trigger (on Insert, Update,
Delete)
I.4.2 Create, Drop trigger, Disable and Enable ti.igger
Unit-2: Database backup and CSV handling:
2.I SQLite dump :
2.I.I Dump specific table into file, Dump onlytable structure
2.I.2 Dump entire database into file
2.I.3 Dump data of one or more tables into a file
2.2 CSV files handling: ®
2.2.I lmportacsvfileintoatable
2.2.2 Export a csv filc fromtable
Unit-3: Python interaction with SQLite:
3. I Module: Concepts of module and Using modules in python.
3.1.I Setting PYTHONPATH, Concepts ofNamcspacc and scope
3.1.2 Concepts of packages in python
3.2 Importing sqljte3 module
3.2.I connect () and execute() incthods.
3.2.2 Single row and multi-row fetch ( fetchone(), fetchall())
3.2.3 Select, Insert. update, dclctc using execute () method.
3.2.4 commit () method.
Unit4: Python Interaction with lexl and CSV:
4. I File handling ( text and CSV files) using CSV modulc :
4.I.I Csv module , File modes: Read , wnte, append
4.2 Important Classes and Functions of csv modules:
4.2.I Open(), reader(), writer(), writerows(), DictReader(),
Dictwritei.()
4.3 Data frame Handling using Panda aiid Numpy:
4.3.I csv and excel file extract and write using Data frame
4.3.2 Extracting specific attributes and rows from data frame.
4.3.3 Central Tendencymeasures :
4.3.3. I mean, median, mode, variance, Standard Deviation
4.3.4 Dataframe functions: head, tail, loc, iloc, value, to_numpy(),
describe()
17 I P a g e
Unit-S: Data Visualization using data frame:
5.1 importing man)lotlib.pyplot and plotting: ( only two dimensional
Plots)
5. I .1 range() , subplot() , legend(), columns(), len() functions.
5.2 scatter plot: concept of Scatter plot, set title, xlabe[ and ylabel)
5.3 Line chart : concept of line plot: plot(), set_title(), legend()
5.4 histogram chart : Concepts of histogram hist(),set title, xlabel and
ylabel
5.5 Bar Chart : Concepts of Bar chart, bar(),set title, xlabel and ylabel.
|Praclical iinplementalion foi. this papei` is not specil`ic to any editor or UI .]
Reference Bool`s I . Leaning with Python, Author: Allen Downe Publisher: DreamTech
Press, ISBN: 978-9351198147
2. Python: The Complete Reference, Author: by Martin C. Brown,
MCGraw Hill Education,ISBN:978-9387572942
3. Leaming Python: Powerful Object-Oriented Programming: 5th Edition,
Author: Lutz M, Publisher: Shroff, ISBN:978-9351102014
4, Python ln -Depth, Author: Ahidjo Ayeva , Kamon Ayeva, Publisher:
BPB Publication, ISBN:978-9389328424
5. The SQLite Handbook, Author: by Rita Blackbum, Publisher: Emereo
Publishing, ISBN :978-1489136459
6. Using SQLite, Author: Jay A. Kreibich, Publisher: O'Reily, ISBN:978-
0596521 189
7. "Python and SQLite: Build a Data Driven Web App", Author: Michael
Driscoll, Publisher: Crcatespace Independent Publishing Platform, ISBN:
978-1484225820
8. "Mastering Python Networking: Your one-stop solution to usmg
Python for network automation, Devops, and Test-Driven Development",
Author: Erie Chou, Publisher: Packt Publishing, ISBN: 978-I 784397005
9. "Python for Data Analysis: Data Wrangling with Pandas, Numpy, and
Ipython", Author: Wcs MCKinney, Publisher: O'Reilly Media, lsBN:
978-1491957660
10. "Head First Python: A Brain-Friendly Guide", Author: Paul Barry ,
Publisher: O'Reilly Media, TSBN: 978-1491919530
11. "Leaning Python: Powerful Object-Oriented Programming", Author:
Mark Lutz, Publisher: O'Reilly Media, ISBN: 978-1449355739
Teaching Methodology Class Work, Discussion, Self-Study, Seminars and/or Assignments
Evaluation Method 50% Internal assessmcnt.
50% External assessment.