Army Public School Shillong Annual Examination - 2022 - 23 Subject: Informatics Practices Class XI Time: 3 Hrs. Max. Marks: 70
Army Public School Shillong Annual Examination - 2022 - 23 Subject: Informatics Practices Class XI Time: 3 Hrs. Max. Marks: 70
g) Name any two attribute which can used with ALTER command in MySQL.
h)
D = (1:2, 3:4, 5:6)
What is wrong in the above code of Python dictionary? Rectify the mistake and re-write the
corrected expression.
i) Python dictionary is immutable. TRUE/FALSE .
j) Which command is used to display the structure of a table in MySQL?
- Page No. 1 of 4 -
2 Answer any five questions from the following program snippets of python. 2 X 5 = 10
a) Refer the following python code and predict the output.
str_val=“HELLO”
L1=list(str_value)
print(L1)
d) What will be the value of D1 after executing the following Dictionary code.
D1 = {'Mohan':95, 'Ram':89, 'Suhel':92, 'Sangeeta':85}
for key in D1:
print(key,':',D1[key])
e) What will be the value of D1 after executing the following Dictionary code.
D1 = {'Mohan':95, 'Ram':89, 'Suhel':92, 'Sangeeta':85}
D1['Meena'] = 78
print(D1)
f) What will be the value of D after executing the following Dictionary code.
D = {'M':95, 'R':89, 'S':92}
D1 = {‘A':25, ‘K':35}
D.update(D1)
print(D)
- Page No. 2 of 4 -
b) Consider the following MySQL table name as EMP and write the query to perform the task.
i) to display all the details who has “a” as the last letter of the ADDRESS.
ii) to display NAME, FATHER of those whose EMP_CODE between is 202 and 204.
iii) to remove all the data of ‘Rahul’.
c) Define a Primary key. Write the syntax to create the EMP table given in Q3(b) with
EMP_CODE as primary key. And write the query to insert at least a row.
d) Differentiate between the Relational Data Model and Heirarchical Data Model. Explain with
examples.
e). Write the rules for nomenclature of a variable.
4. Consider the following table and write the query for (i) to (vi) and output for (vii) to (x). 1 X 10 = 10
Table name : MARKET
ADM_NO CATEGORY FATHER STU_NAME SALARY PHONE VEHICLE
APS101 JCO Jason Rameshor 50000 1234567 Yes
APS 105 ORs Rishab Das Asween 60000 7956411 No
APS 103 Civil Proloy Nath Anil Kasya 70000 1024668 Yes
APS 102 Staff Kukrejha Thomson 80000 5787999 Yes
APS 104 Teacher Sunita Alexendir 90000 3547899 No
APS 108 MTS Pintu Anita 20000 7897888 No
APS 109 LDC Sany Santosh 30000 8968888 No
APS 111 JCO Ammy Anthony 25000 7878787 Yes
i). to insert all the values using appropriate command. (write only one in the answer script)
ii). change the data type of attribute “ SALARY “ to varchar with size 20.
iii). to replace the category “ Civil ” by “ General ”.
iv). to display all those Father whose STU_NAME has “ x “ as the fourth letter.
v). display all the Admission no. in descending order of the Name who work as JCO.
vi). to increase the SALARY of all by increasing 10% of the existing SALARY.
vii). select ADM_NO from MARKET where SALARY between 50000 and 80000;
viii). alter table MARKET drop VEHICLE ;
ix). update MARKET set ADM_NO= ‘ ‘ where STU_NAME like ‘_ _ _ _ e%’;
x). select CATEGORY, FATHER from MARKET order by SALARY desc;
- Page No. 3 of 4 -
5. Choose the correct option of any ten questions from the following. 1 X 10 = 10
a) What will be the order of the data being sorted after the execution of given SQL query?
SELECT * From School Order by Class;
(a) Order of inserting records in a table (b) Ascending order
(c) Descending order (d) None of these
b) Which clause in SQL is used to apply a condition in a transaction of SQL?
(a) As (b) Having (c) Where (d) On
c) Identify the valid variable name from the following literals
a) P Q b) P$Q c) P+Q d) PQ
d) _____ constraint is used to check duplicity of values in MySQL tables and discard if repeated.
(a) Unique (b) Remove (c) Distinct (d) All
e) Which of the following commands will change row(s) of the table from MySQL database?
(a) REPLACE TABLE (b) CHANGE TABLE (c) UPDATE (d) ALTER TABLE
f) DML stands for ____________________.
- Page No. 4 of 4 -