SSSaraswatiaraswatiaraswati IIINFORMATICS ...
Strictly in accordance with the new CBSE syllabus 2020-21
I P Saraswati
ivate NFORMATICS RACTICES r [Supplement for CLASS XII]
e (India) P By s Reeta Sahoo Saraswati Hou M.C.A.
Gagan Sahoo M.C.A.
Limited
New
@
New Saraswati House (India) Pvt. Ltd.
New Delhi-110002 (INDIA)
C O N T E N T S
Chapter?1 Transferring CSV/SQL Data into DataFrame .................................................... 1?14
1.1 Introduction ...................................................................................................................... 1 1.2 CSV File ............................................................................................................................. 1
1.2.1 Creating and Reading CSV File ............................................................................ 1
d 1.2.2 Saving DataFrame as CSV File ............................................................................. 8 ite 1.3 SQL File ............................................................................................................................ 10
Points to Remember ................................................................................................................ 13
im Solved Exercises ....................................................................................................................... 13 L Review Questions .................................................................................................................... 14 te Chapter?2 Operations on Relation ................................................................................... 15-26 iva 2.1 Introduction ................................................................................................................... 15 r 2.2 Database Management System .................................................................................... 15 P 2.3 Relational Database ....................................................................................................... 15 ) 2.4 The Relational Data Model ............................................................................................ 15 ia 2.5 Keys ................................................................................................................................. 16
d 2.5.1 Primary Key ....................................................................................................... 16 In 2.5.2 Foreign Key ........................................................................................................ 17 ( 2.5.3 Candidate Key .................................................................................................... 17 e 2.5.4 Alternate Key ..................................................................................................... 18 s 2.5.5 Composite Key ................................................................................................... 18 u 2.6 Relational Algebra .......................................................................................................... 18 o 2.6.1 The Select Operation ......................................................................................... 18 H 2.6.2 The Projection Operation .................................................................................. 19 ti 2.6.3 The Union Operation ......................................................................................... 20 a 2.6.4 The Intersection Operation ............................................................................... 20 w 2.6.5 The Difference Operation .................................................................................. 20 s 2.6.6 The Cartesian Product Operation ..................................................................... 20 ra 2.6.7 The Join Operation ............................................................................................ 21 a Points to Remember ............................................................................................................... 22 S Solved Exercises ...................................................................................................................... 22 wReview Questions .................................................................................................................... 25 e Chapter?3 MySQL Functions ............................................................................................. 27?41 N3.1 MYSQL FUNCTIONS ........................................................................................................ 27 @ 3.2 Character/String Functions ............................................................................................ 27
3.3 Numeric Functions ......................................................................................................... 33 3.4 Date Functions ................................................................................................................ 36 Points to Remember ................................................................................................................ 39 SOLVED EXERCISES ......................................................................................................................... 39 REVIEW QUESTIONS ....................................................................................................................... 41
Chapter?4 Computer Networking ...................................................................................... 42?83
(2)
4.1 Introduction ................................................................................................................ 42
4.2 What is a Network? .................................................................................................... 42
4.3 Need for Networking .................................................................................................. 42
4.4 Elementary Terminology of Networks ...................................................................... 43
4.5 Types of Networks ...................................................................................................... 43
4.5.1 Local Area Network (LAN) ......................................................................... 43
4.5.2 Metropolitan Area Network (MAN) ......................................................... 44
d 4.5.3 Wide Area Network (WAN) ....................................................................... 44 ite 4.5.4 Personal Area Network (PAN) ................................................................... 45
4.6 Evolution of Networking ............................................................................................ 45
im 4.6.1 ARPANET .................................................................................................... 45 L 4.6.2 The Internet ............................................................................................... 45 te 4.6.3 The InterSpace ........................................................................................... 45 a 4.6.4 World Wide Web ....................................................................................... 46 iv 4.7 Data Communication Terminologies ......................................................................... 46 r 4.8 Transmission Media ................................................................................................... 47 ) P 4.8.1 Wired Networking ..................................................................................... 47 ia 4.8.2 Wireless Networking ................................................................................. 49 d 4.9 Cloud Networking ....................................................................................................... 53 In 4.10 Client Server Concepts ............................................................................................... 53 ( 4.11 Network Topologies .................................................................................................... 54 e 4.11.1 Bus Topology .............................................................................................. 54 s 4.11.2 Ring Topology............................................................................................. 55 u 4.11.3 Star or Radial Topology ............................................................................. 55 o 4.11.4 Tree Topology ............................................................................................. 56 ti H 4.11.5 Mesh Topology .......................................................................................... 56
4.12 Network Components/Devices .................................................................................. 57
a Points to Remember ............................................................................................................... 62 sw Solved Exercises ...................................................................................................................... 63 a Review Questions .................................................................................................................... 79 ar Chapter?5 Network Protocols and Applications ............................................................... 84?96 S 5.1 Introduction to Internet ............................................................................................. 84
5.2 URL ........................................................................................................................ 8 4
ew 5.2.1 Different Protocols for URLs ......................................................................... 85 N5.3 WWW and its Application ......................................................................................... 85
@
5.4
5.3.1 Application of WWW ..................................................................................... 86 Website ....................................................................................................................... 87
5.5 Web Browser ............................................................................................................... 90
5.6 Browser Settings ......................................................................................................... 91
5.7 Add-ons and Plug-ins ................................................................................................. 92
Points to Remember ............................................................................................................... 93
Solved Exercises ...................................................................................................................... 93
Review Questions .................................................................................................................... 96
(3)
33444444455555556666666777777788888889999999000000011111112222222111111122222223333333444444455555556666666T77777778888888r9999999a0000000n11111112222222s3333333f4444444e5555555r6666666r7777777i8888888n99999990000000g11111112222222C33333334444444S55555556666666V7777777/8888888S99999990000000Q11111112222222L11111112222222D33333334444444a5555555t6666666a77777778888888i9999999n00000001111111t2222222o33333334444444D55555556666666a7777777t8888888a9999999F00000001111111r2222222a3333333m444444455555556666666e77777778888888999999900000001111111222222211111112222222333333344444445555555666666677777778888888999999900000001111111222222233333334444444555555566666667777777888888899999990000000111111122222223333333444444455555556666666777777788888889999999000000011111112222222111111122222223333333444444455555556666666777777788888889999999000000011111112222222333333344444445555555
1
Transferring CSV/SQL Data
into DataFrame
ChaapteteLrim?ite1d 1.1 Introduction
riv Pandas is one of the popular Python package for manipulating data frames. Pandas is built on top of NumPy P and thus it makes data manipulation fast and easy. In previous two chapters we learnt about pandas data ) analysis using different data frames. Most of times we use Python dictionary as a source of data. But we ia can create DataFrames from other input data formats such as CSV, JSON, SQL database, etc.
d In this chapter we will work with CSV files/SQL databases that how they transfer data between data In frames. e ( 1.2 CSV File us A file with the CSV file extension is a Comma Separated Values file. A CSV file is a text file containing data o in table form, where columns are separated using the `,' comma character, and rows are on separate lines. H All CSV files are plain text files, can contain numbers and letters only, and structure the data contained ti within them in a tabular, or table, form. Files of this format are generally used to exchange data, usually a when there's a large amount, between different applications. w 1.2.1 Creating and Reading CSV File ras To work with a DataFrame, we need data. The data can be in any form: a series, a dictionary, a CSV file, etc.
Sa Creating/Opening CSV File w A CSV is created using spreadsheet software like OpenOffice Calc, Kingsoft Spreadsheets or Microsoft e Excel. Spreadsheet tools are great for CSV files because the data contained is usually going to be filtered or N manipulated in some way after opening. You can also use a text editor to open CSV files, but large ones will @ be very difficult to work with in these types of programs.
All CSV files follow the same overall format: each column is separated by a delimiter (like a comma), and each new line indicates a new row. Some programs that export data to a CSV file may use a different character to separate the values, like a tab, semicolon, or space.
Let us create a CSV file using both OpenOffice Calc and Microsoft Excel.
Using OpenOffice Calc
Step 1. Start OpenOffice Calc.
1
2
Saraswati 1111111222222233333334444444555555566666667777777888888899999990000000111111122222223333333444444455555556666666777777788888889999999000000011111112222222333333344444445555555666666677777778888888999999900000001111111222222211111112222222333333344444445555555666666677777778888888999999900000001111111222222233333334444444555555566666667777777888888899999990000000111111122222223333333444444455555556666666777777788888889999999000000011111112222222111111122222223333333444444455555556666666777777788888889999999000000011111112222222In33333334444444f5555555o6666666r7777777m888888899999990000000a1111111t2222222i3333333c4444444s55555556666666P77777778888888r9999999a00000001111111c2222222t1111111i2222222c3333333e44444445555555s66666667777777X88888889999999II000000011111112222222333333344444445555555666666677777778888888999999900000001111111222222233333334444444
Step 2. Type the data which is shown in Figure 1.1. Also notice that some cell values are missing to represent missing values (NaN) in pandas DataFrame.
rivate Limited Figure 1.1 OpenOffice Calc worksheet data. Saraswati House (India) P Step 3. Click File >> Save Or press Ctrl + S to open the Save As window as shown in Figure 1.2.
New @
Figure 1.2 Saving spreadsheet data in CSV format. Step 4. Select the location (folder) where you want to save the file. Step 5. Type the file name as Supplier in the File name box as shown in Figure 1.2. Step 6. Click on the Save as type drop-down arrow and select Text CSV (.csv) (*.csv).
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.