Beruflich Dokumente
Kultur Dokumente
Q1. Explain the difference between degree and cardinality of a relation in MySql. (2)
Q2. Which command is used to remove redundancy/ duplicity from select query? Expian giving example.
(2)
Q3. Identify DDL and DML queries amongst the following:- (2)
i) Drop
ii) Alter
iii) update
iv) create
Q4. What are the two characters we can use with like operator? Explain giving examples. (2)
Q5. Explain : i) Primary Key ii) Alternate Key (2)
Q6. Write SQL queries for (i) to (iv) and outputs for (v) to (viii):
(i) Write the data types of SID and DOB columns. (1)
(ii) Display names of Salespersons and their Salaries who have salaries in the
range 30000.00 to 40000.00. (1)
(iii) To list Names, Phone numbers and DOB (Date of Birth) of Salespersons who were born
before 1st November, 1992. (1)
(iv) To display Names and Salaries of Salespersons in descending order ofsalary.
(1)
(v) To display Names of Salespersons who have the word ‘Kumar’ anywhere in their names.
(1)
(vi) SELECT Name, LENGTH(Name) FROM Salesperson; (1)
(vii) SELECT Area, Name fom Salesperson where area in(“north”, “south”); (1)
(viii) SELECT sum(Salary) FROM Salesperson where area=’North’; (1)
Q7. Write a recursive code to find factorial of a number. (3)
Q8. What is the difference between Recursion and iteration? Explain giving examples. (2)
Q9. Which command is used for the following cases in Django (3)
i. To create a Django project “Mysite”
ii. To create a an app “details “ in “Mysite”
iii. To run the server in virtual environment
Q10. Write to create a pie for sequence con=[23.4,17.8,25,34,40] for
zones=[‘east’,’west’,’north’,’south’,’central’]. (3)
• Show North zone value exploded.
• Show % contribution for each zone.
• The pie chart should be circular.
Q12. Write a program to count number of upper-case alphabets present in a text file “Article.txt”. (2)
Q13. Write a program that copies a text file “source.txt” onto “target.txt” barring the lines starting with
“@” sign. (2)
Q14. What possible outputs(s) are expected to be displayed on screen at the time of execution of the
program from the following code? Also specify the maximum values that can be assigned to each of the
variables FROM and TO. (2)
import random
AR=[20,30,40,50,60,70];
FROM=random.randint(1,3)
TO=random.randint(2,4)
for K in range(FROM,TO+1):
print (AR[K],end=”#“)