Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 3

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 3

Q1. Write two advantages of SQL.

Q2. MySQL is an ___________Software. (open source/Proprietary)

Q3. Name two types of SQL commands.

Q4. What is the difference between DDL and DML Commands?

Q5. Identify the DDL and DML commands from the following.

  1. Create
  2. Alter
  3. Insert
  4. Update
  5. Drop
  6. Delete
  7. Select
  8. Grant
  9. Revoke

Q6. What do you mean by data type?

Q7. Name two numeric data type in MySQL.

Q8. Name two String Data type in MySQL.

Q9. Which data type is used for "Date of birth" field in Student table.

Q10. What is the difference between Char and Varchar.

SOLUTIONS:

Q1. Write two advantages of SQL.

Ans. 

  • It is very easy to learn
  • It is not a case sensitive language.
Q2. MySQL is an ___________Software. (open source/Proprietary)
Ans. open source

Q3. Name two types of SQL commands.
Ans
  1. DDL
  2. DML
Q4. What is the difference between DDL and DML Commands?
Ans. 

DDL

DML

It stands for Data Definition Language

It stands for Data Definition Language

These commands allow   to perform tasks related   to the structure of the table

 

These commands are used to manipulate data

       



Q5. Identify the DDL and DML commands from the following.
  1. Create
  2. Alter
  3. Insert
  4. Update
  5. Drop
  6. Delete
  7. Select
  8. Grant
  9. Revoke

Ans
  1. DDL
  2. DDL
  3. DML
  4. DML
  5. DDL
  6. DML
  7. DML
  8. DDL
  9. DDL
Q6. What do you mean by data type?
Ans. Data type refers to the type of data we are entering in the column of the table.

Q7. Name two numeric data type in MySQL.
Ans. Integer and Smallint

Q8. Name two String Data type in MySQL.
Ans. Char and Varchar

Q9. Which data type is used for "Date of birth" field in Student table.
Ans. Date

Q10. What is the difference between Char and Varchar.
Ans. Char is fixed length data type while Varchar is variable length data type.

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 2

 

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 2

Q1. What do you mean by data redundancy?

Q2. What do you mean by data inconsistency?

Q3. Define the term data model.

Q4. Name 3 types of data models.

Q5. A ___________ is a collection of logically related data.

Q6. Answer the following questions on the basis the given table.


a. How many attributes are there in above table?
b. How many tuples are there in above table?
c. What is the degree of above table?
d. What is the cardinality of above table?
e. Name the primary key in the table.

Q7. Write any five attributes of book entity.

Q8. Write any two advantages of database.

Q9. What is the purpose of creating primary key in table.

Q10. Which field you choose as primary key out of following in "Employee" table
  1. Emp_id
  2. Emp_name
  3. Emp_salary
  4. Emp_desig

Ans 1.                                                                                     

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 1

 

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 1

Q1. Write full form of DBMS.

Q2. Define the following term

  1. Primary Key
  2. Foreign Key
  3. Candidate Key
  4. Alternate Key

Q3. A group of rows and columns is called _______________

Q4. Candidate Key - Primary key = ___________________

Q5. Give two examples of DBMS software.

Q6. What is the difference between Data and Information?

Q7. A primary key is one of the candidate key. (True/False)

Q8. What do you mean by degree and cardinality in DBMS?

Q9. What is the alternate name of column in table?

Q10. What is the alternate name of row in table?



SOLUTIONS:


Q1. Write full form of DBMS.

Ans. Database Management System

Q2. Define the following term

  1. Primary Key
  2. Foreign Key
  3. Candidate Key
  4. Alternate Key
Ans. 
  1. A field which uniquely identifies each and every record.
  2. FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another table. It is used to link two tables.
  3. Those fields which can act as a primary key are called candidates key
Q3. A group of rows and columns is called _______________

Ans Table

Q4. Candidate Key - Primary key = ___________________

Ans. Alternate Key

Q5. Give two examples of DBMS software.

Ans. Oracle, MS Access, MySQL

Q6. What is the difference between Data and Information?

Ans. Raw facts and figures is called Data. 
        Processed data is called information

Q7. A primary key is one of the candidate key. (True/False)

Ans. True

Q8. What do you mean by degree and cardinality in DBMS?

Ans. Number of rows in a table is called cardinality
        Number of columns in a table is called degree.

Q9. What is the alternate name of column in table?

Ans. Attribute and Field 

Q10. What is the alternate name of row in table?

Ans. Record and Tuple

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test Part 7

                                        

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test  Part 7

Q1. Write a function in python that takes a list of words and returns the 

      word of longest length.

Q2. Write a function in python that takes a list of words and returns the 

       word which are starting from capital alphabet.

Q3. Write a function in python that takes a list of words and returns all the 

      words with last character in upper case.

Q4. Write a function in python that takes a string and convert all lower case

      alphabet to upper case and vice-versa.

Q5. Write a function in python that takes a string and replace all vowels by

      symbol "?".

Q6. Write a function in python that takes a string and count the characters 

      in upper case.

Q7. Write a function in python that takes a string and count the number of

       vowels.

Q8. Write a function in python that takes a string and count the number of 

      spaces.

Q9. Write a function in python that takes a string and count the number of

      digits in a string.

Q10. Write a function in python that takes a string and sub string and check

        whether a sub string is a part of string or not.


Solutions

Ans1:

def longword(a):
ln=0
for i in range(len(a)):
if ln<len(a[i]):
ln=len(a[i])
lwrd=a[i]
print("longest word is",lwrd)
longword(["Amit","Ashish","Anshuman"])

Output is : longest word is Anshuman

Ans 2
def capword(a):
for i in range(len(a)):
if a[i][0].isupper():
print("Result is",a[i])
capword(["amit","Ashish","anshuman"])

Output is : Result is Ashish

Ans 3:
def capword(a):
for i in range(len(a)):
if a[i][-1].isupper():
print("Result is",a[i])
capword(["amiT","Ashish","anshuman"])

Output is : Result is amiT

Ans 4:
def swapcase(a):
ns=''
l=len(a)
for i in range(l):
if a[i].isupper():
ns=ns+a[i].lower()
else:
ns=ns+a[i].upper()
print("Result is",ns)
swapcase("Subscribe to My Blog")

Output is: Result is sUBSCRIBE TO mY bLOG

Ans 5:

def swapvow(a):
ns=''
l=len(a)
for i in range(l):
if a[i] in "aeiouAEIOU":
ns=ns+'?'
else:
ns=ns+a[i]
print("Result is",ns)
swapvow("Subscribe to My Blog")

Output is : Result is S?bscr?b? t? My Bl?g

Ans 6:

def countupper(a):
c=0
l=len(a)
for i in range(l):
if a[i].isupper():
c=c+1
print("Result is",c)
countupper("Subscribe to My Blog")

Output is : Result is 3

Ans 7:
def countvowel(a):
c=0
l=len(a)
for i in range(l):
if a[i] in "aeiouAEIOU":
c=c+1
print("Result is",c)
countvowel("Subscribe to My Blog")

Output is : Result is 5

Ans 8:

def countspace(a):
c=0
l=len(a)
for i in range(l):
if a[i].isspace():
c=c+1
print("Result is",c)
countspace("Subscribe to My Blog")

Output is : Result is 3

Ans 9:
def countdigit(a):
c=0
l=len(a)
for i in range(l):
if a[i].isdigit():
c=c+1
print("Result is",c)
countdigit("Subscribe 2 My Blog 123")

Output is : Result is 4

Ans 10:

def checksub(a,b):
if b in a:
print("Result is","Present")
else:
print("Result is","not present")
checksub("Subscribe to My Blog",'to')

Output is : Result is Present


Computer Science - Informatics Practices Class XI/XII Python Module Solved Test Part 6

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test  Part 6

Q1. Name the module to be imported for using mathematical functions.

Q2. Name the module to be imported for generating random numbers.

Q3. Name the module to be imported for text manipulation functions.

Q4. Write the value of the following (till 2 decimal places)

>>> import math

>>>print(math.pi)

>>>print(math.e)

Q5. Name two angle conversion methods of math module.

Q6. degree and radians are functions of _____________ module.

Q7. Write a program in python to find the roots of a quadratic equation.

A quadratic equation is of the form: ax2 + bx + c

Accept values of a, b and c from user.

formula of finding root is: x = [-b +/- sqrt(b2 - 4ac)]/2a

Q8. Write a program to accept angle in degree and convert it into radian.

Q9. Write a python program to convert binary number to decimal number

Q10. Write a python program to convert decimal number to binary.

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test Part 5

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test  Part 5

Q1. Name the library which is to be imported to use the following functions.

a. log()                            b. pow()

Q2. Create a module temp.py which contain the following functions.

a. ctk()  #which converts degree celsius to kelvin.

b. ctf()  #which converts degree celsius to fahrenheit.

Q3. Write a function in2f() in python which takes input in inches and display result in feet. [1feet = 15inches]

Q4. Write the output of the following:

import math

print(math.floor(7.2))

Q5. How modules and packages are related to each other?

Q6. Create a module vol.py which contains the following functions.

a. volcyl() # which calculates volume of cylinder.

b. volcube() # Which calculate volume of cube.

c. volcuboid() #Which calculates volume of cuboid

Q7. What is library in python?

Q8. State the difference between import math and from math import* 


Computer Science - Informatics Practices Class XI/XII Python Module Solved Test Part 4

Computer Science - Informatics Practices Class XI/XII Python Module Solved Test  Part 4

Q1. Write the output of following code.

CODE

OUTPUT

a = 10

def fun():

  a=9

  a=a+2

  print(a)

fun()

 


a = 10

def fun():

  a=9

  a=a+2

  print(a)

fun()

print(a)

 


a = 10

def fun():

  global a

  a=a+2

  print(a)

fun()

print(a)

 


a = 10

def fun():

  global a

  a=a+2

  print(a)

print(a)

fun()

 

 

 


Q2. Write the output of the following:
a = 10
def fun():
global a
a=a+2
print(a)
fun()
print(a)

Q3. Write the output of the following
a = 10
print(a+3)
def fun():
global a
a=a+2
print(a)
fun()
print(a)

Q4. Write the output of the following.
a = 10
print(a*3)
def fun():
print(a)
fun()
print(a)

Q5. Write the output of the following.
a = 10
print(a*3)
def fun(a):
print(a*2)
fun(a)
print(a)

Q6. Write the output of the following:
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print(a*2)
fun2()
fun1(a)
print(a)

Q7. Write the output of the following.
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print("hello")
print(a*2)
fun2()
fun1(a)
print(a)

Q8. Write the output of the following.
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print("hello")
print(a*2)
fun2()
print("hello")
print("hello")
fun1(a)
print(a)



                                            SOLUTION

Q1. Write the output of following code.

CODE

OUTPUT

a = 10

def fun():

  a=9

  a=a+2

  print(a)

fun()

 

11

a = 10

def fun():

  a=9

  a=a+2

  print(a)

fun()

print(a)

 

11

10

a = 10

def fun():

  global a

  a=a+2

  print(a)

fun()

print(a)

 

12

12

a = 10

def fun():

  global a

  a=a+2

  print(a)

print(a)

fun()

 

 

10

12 


Q2. Write the output of the following:
a = 10
def fun():
global a
a=a+2
print(a)
fun()
print(a)

Ans
10
12

Q3. Write the output of the following
a = 10
print(a+3)
def fun():
global a
a=a+2
print(a)
fun()
print(a)
Ans.
13
10
12

Q4. Write the output of the following.
a = 10
print(a*3)
def fun():
print(a)
fun()
print(a)

Ans.
30
10
10

Q5. Write the output of the following.
a = 10
print(a*3)
def fun(a):
print(a*2)
fun(a)
print(a)

Ans.
30
20
10

Q6. Write the output of the following:
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print(a*2)
fun2()
fun1(a)
print(a)

Ans.
30
20
hello
10

Q7. Write the output of the following.
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print("hello")
print(a*2)
fun2()
fun1(a)
print(a)

Ans.
30
hello
20
hello
10

Q8. Write the output of the following.
a = 10
print(a*3)
def fun1(a):
def fun2():
print("hello")
print("hello")
print(a*2)
fun2()
print("hello")
print("hello")
fun1(a)
print(a)

Ans.
30 hello hello 20 hello hello 10

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet