Amit Kumar Gupta PGT CS Anna Nagar Chennai-9444428755



SAMPLE PAPER

PT TEST-II

INFORMATICS PRACTICES (065)

Class – XI

Time Allowed: 90 Mins. Maximum Marks: 50

Instructions:

i) All questions are compulsory.

ii) Programming language: Python, SQL

|1. |(a) |What is meant by Relation in RDBMS? Explain with example. |2 |

| |(b) |What is a primary key? How is it different from foreign key? |2 |

| |(c) |What is the use of WHERE clause in UPDATE command? What will happen in-case WHERE clause is not used in UPDATE command? |2 |

| |(d) |Write MySQL command to display the structure of Medicine table. |1 |

| |(e) |Write MySQL command to display the list of available tables in a database. |1 |

| |(f) |What is a candidate key? Explain with example. |2 |

| |(g) |Which two wild characters are used in LIKE clause? Explain using example. |2 |

|2. |(a) |Write any two differences between DDL & DML commands. |2 |

| |b |What is the role of order by clause in MySql? Explain with example. |2 |

| |C |Write the SQL commands for the (i) to (iv) and write the output of the (v) & (vi) on the basis of table TEACHER given |5 |

| | |below: | |

| | | | |

| | |TABLE:TEACHER | |

| | |No | |

| | |Name | |

| | |Age | |

| | |Department | |

| | |Doj | |

| | |Salary | |

| | |Gender | |

| | | | |

| | |1 | |

| | |Sunil | |

| | |34 | |

| | |Computer | |

| | |1997/01/10 | |

| | |12000 | |

| | |M | |

| | | | |

| | |2 | |

| | |Sharmila | |

| | |31 | |

| | |History | |

| | |1998/03/24 | |

| | |20000 | |

| | |F | |

| | | | |

| | |3 | |

| | |Sandeep | |

| | |32 | |

| | |Maths | |

| | |1996/12/12 | |

| | |30000 | |

| | |M | |

| | | | |

| | |4 | |

| | |Rita | |

| | |35 | |

| | |History | |

| | |1999/07/01 | |

| | |40000 | |

| | |F | |

| | | | |

| | |5 | |

| | |Gurmit | |

| | |42 | |

| | |Maths | |

| | |1997/09/05 | |

| | |25000 | |

| | |M | |

| | | | |

| | |6 | |

| | |Nilesh | |

| | |50 | |

| | |History | |

| | |1998/06/27 | |

| | |30000 | |

| | |M | |

| | | | |

| | |7 | |

| | |Kirti | |

| | |44 | |

| | |Computer | |

| | |1997/02/25 | |

| | |21000 | |

| | |M | |

| | | | |

| | |8 | |

| | |Shalakha | |

| | |33 | |

| | |Maths | |

| | |1997/07/31 | |

| | |20000 | |

| | |F | |

| | | | |

| | | | |

| | | | |

| | |To show all information about the teacher of History and Maths department. | |

| | |To display the name of male teachers with their salary. | |

| | |To display name, age and department of all teachers in descending order of doj. | |

| | |To display detail of teachers who are not in History department. | |

| | |Select name from TEACHER where name like ‘%a’ ; | |

|3. |(a) |Create table Supplier as per following Table Instance Chart. |2 |

| | | | |

| | |Column Name | |

| | |SID | |

| | |SName | |

| | |SAddr | |

| | |SCity | |

| | |SPhone | |

| | | | |

| | |DataType | |

| | |Integer | |

| | |Varchar | |

| | |Varchar | |

| | |Varchar | |

| | |Varchar | |

| | | | |

| | |Length | |

| | | | |

| | |30 | |

| | |30 | |

| | |30 | |

| | |20 | |

| | | | |

| | |Constraint | |

| | |Primary key | |

| | |Not Null | |

| | | | |

| | | | |

| | |Unique | |

| | | | |

| | | | |

| | | | |

| |(b) |Write MySQL commands based on the table “Student” given below : |2 |

| | |Table: Student | |

| | |Sid | |

| | |Sname | |

| | |Age | |

| | |StrId | |

| | |Class | |

| | | | |

| | |1 | |

| | |Sawan | |

| | |10 | |

| | |1 | |

| | |11 | |

| | | | |

| | |2 | |

| | |Deepa | |

| | |12 | |

| | |1 | |

| | |10 | |

| | | | |

| | |3 | |

| | |Radha | |

| | |14 | |

| | |2 | |

| | |9 | |

| | | | |

| | |4 | |

| | |Mohan | |

| | |11 | |

| | |3 | |

| | |11 | |

| | | | |

| | |5 | |

| | |Shiva | |

| | |10 | |

| | |2 | |

| | |10 | |

| | | | |

| | | | |

| | |To delete all the records from student table. | |

| | |To increase the class column value of all students by 1. | |

| |(c) |Consider the following table Product. Write MySQL commands for the statement (i) to (vi). |5 |

| | |TABLE : PRODUCT | |

| | |pId | |

| | |Pname | |

| | |Suppname | |

| | |Expiry | |

| | |Qty | |

| | |Price | |

| | |Discount | |

| | | | |

| | |1 | |

| | |Horlicks500gm | |

| | |Durga Traders | |

| | |2012-02-01 | |

| | |120 | |

| | |155 | |

| | |2 | |

| | | | |

| | |2 | |

| | |Pickle250gm | |

| | |Rajshree | |

| | |2013-08-12 | |

| | |12 | |

| | |145 | |

| | |5 | |

| | | | |

| | |3 | |

| | |Milk Pwd 500gm | |

| | |Ratans | |

| | |2012-07-12 | |

| | |14 | |

| | |250 | |

| | |10 | |

| | | | |

| | |4 | |

| | |Biscuits | |

| | |Durga Traders | |

| | |2013-10-10 | |

| | |200 | |

| | |5 | |

| | |1 | |

| | | | |

| | |5 | |

| | |Chocolate | |

| | |Rajshree | |

| | |NULL | |

| | |240 | |

| | |10 | |

| | |NULL | |

| | | | |

| | | | |

| | |To display the details of products . | |

| | |To display the product name and total price of all products where total price is calculated as (qty*price). | |

| | |To display the products where discount is not given. | |

| | |To display products having price between 100 to 200. | |

| | |To display the records of those products whose Pname starts with ‘B’ | |

| | |. | |

|4 | | |1 |

| | |(i) What is the significance of Pandas Library? | |

| | | |1 |

| | |(ii) Write code to create an ndarray having six zeros in it. Write statements to change 2nd and 4th elements to 30 and 40 | |

| | |respectively. |1 |

| | | | |

| | |(iii) Why does following code cause error? |3 |

| | |S1=pd.Series(range(1,15,3),index=list(‘abcd’)) | |

| | | | |

| | |(iv) Write code statements to list the following from a dataframe namely df:- | |

| | |List only columns ‘item’ and ’price’. | |

| | |List rows from 2 to 6. | |

| | |List the value of cell in 3rd row, ‘item’ column. | |

| | | | |

|5 |(a) | |1 |

| | |What is the another name of NumPy? | |

| | | | |

| | | | |

| |(b) | |2 |

| | |Name any two functions of numpy module to create numpy array? | |

| | | | |

| |(c) | |2 |

| | |What is the use of head() and tail() functions in Pandas? | |

| | | | |

| |(d) | |2 |

| | |Name functions used to combine two dataframes? | |

| | | | |

| |(e) |Write output of following code: |2 |

| | |import pandas as pd | |

| | |my_series=pd.Series({50:'Jabalpur',30:'Jaipur',70:'Bhopal'}) print(my_series) | |

| | | | |

|6 |(a) |How is Series data structure different from a dataframe data structure? |2 |

| |(b) |Write output of following code: |2 |

| | |import pandas as pd | |

| | |my_series=pd.Series([10,20,25,'name',565]) | |

| | |print(my_series.head()) | |

| | |print(my_series.head(4)) | |

| |(c) |In NumPy dimensions are called ……….? |1 |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download