Advertisements
Advertisements
Which function is used to display the total number of records from a table in a database?
Concept: Functions in SQL
What will the following expression be evaluated for in Python?
print(15.0 / 4 + (8 + 3.0))
Concept: Notations for Arithmetic Expressions
Differentiate between count() and count(*) functions in SQL with appropriate examples.
Concept: Functions in SQL
Write the outputs of the SQL queries based on the relations Teacher and Placement given below:
Table: Teacher
T_ID | Name | Age | Department | Date_of_join | Salary | Gender |
1 | Arunan | 34 | Computer Sc | 2019-01-10 | 12000 | M |
2 | Saman | 31 | History | 2017-03-24 | 20000 | F |
3 | Randeep | 32 | Mathematics | 2020-12-12 | 30000 | M |
4 | Samira | 35 | History | 2018-07-01 | 40000 | F |
5 | Raman | 42 | Mathematics | 2021-09-05 | 25000 | M |
6 | Shyam | 50 | History | 2019-06-27 | 30000 | M |
7 | Shiv | 44 | Computer Sc | 2019-02-25 | 21000 | M |
8 | Shalakha | 33 | Mathematics | 2018-07-31 | 20000 | F |
Table: Placement
P_ID | Department | Place |
1 | History | Ahmedabad |
2 | Mathematics | Jaipur |
3 | Computer Sc | Nagpur |
- SELECT Department, avg(salary) FROM Teacher GROUP BY Department;
- SELECT MAX(Date_of_Join), MIN(Date_of_Join) FROM Teacher;
- SELECT Name, Salary, T.Department, Place FROM Teacher T, Placement P WHERE T.Department = P.Department AND Salary>20000;
- SELECT Name, Place FROM Teacher T, Placement P WHERE Gender = ’F’ AND T.Department = P.Department;
Concept: Functions in SQL
Write the output of the code given below:
p=5
def sum(q,r=2):
global p
p=r+q**2
print(p, end= '#')
a=10
b=5
sum(a,b)
sum(r=5,q=1)
Concept: Notations for Arithmetic Expressions
Predict the output of the code given below:
s="welcome2cs"
n = len(s)
m=""
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m +s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'&'
print(m)
Concept: Functions in SQL
Which function returns the sum of all elements of a list?
Concept: Functions in SQL
What will the following expression be evaluated for in Python?
print (4 + 3 * 5/3 − 5 % 2)
Concept: Notations for Arithmetic Expressions
State any one Absorption Law of Boolean Algebra and verily it using truth table.
Concept: Truth Tables (Boolean Algebra)
Draw the Logic Circuit of the following Boolean Expression
(U' + v).(V' + W')
Concept: Application of Boolean Logic - Digital Electronic Circuit Design Using Basic Logic Gates (NOT, AND, OR, NAND, NOR)
Derive a Canonical POS expression for a Boolean function FN, represented by the following truth truth table:
X | y | z | FN (X, Y, Z) |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Concept: Obtaining Sum of Product (SOP) and Product of Sum (POS) Form the Truth Table
Reduce the following Boolean Expression to its simplest form using K-Map:
`G(U, V,W, Z) = sum(3,5 , 6 , 7 , 11 , 12 ,13, 15)`
Concept: Reducing Boolean Expression (SOP and POS) to Its Minimal Form
State DeMorgan's Laws of Boolean Algebra and verify them using a truth table.
Concept: DeMorgan’S Law/Theorem and Their Applications
Draw the Logic Circuit of the following Boolean Expression using only NOR Gates
(A+B).(C+D)
Concept: Application of Boolean Logic - Digital Electronic Circuit Design Using Basic Logic Gates (NOT, AND, OR, NAND, NOR)
Derive a Canonical POS expression for a Boolean function G, represented by the following truth table:
X | Y | Z | G(X, Y, Z) |
0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Concept: Obtaining Sum of Product (SOP) and Product of Sum (POS) Form the Truth Table
Reduce the following Boolean Expression to its simplest form using K-Map:
`E (U, V, Z, W) = sum (2, 3 , 6, 8, 9, 10, 11 , 12 , 13 )`
Concept: Use of Karnaugh Map for Minimization of Boolean Expressions (Up to 4 Variables)
Verify the following using Boolean Laws : U'+V = U'V'+ U' .V + U.V
Concept: Commutative Law
Draw the Logic Circuit for the following Boolean Expression: (X'+Y).Z + W'
Concept: Application of Boolean Logic - Digital Electronic Circuit Design Using Basic Logic Gates (NOT, AND, OR, NAND, NOR)
Derive a Canonical POS expression for a Boolean function F, represented by the following truth table
P | Q | R | F(P,Q,R) |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 0 |
1 | 1 | 1 | 1 |
Concept: Obtaining Sum of Product (SOP) and Product of Sum (POS) Form the Truth Table
Reduce the following Boolean Expression to its simplest form using K-Map
`F (X, Y, Z, W) = sum (0, 1, 4, 5, 6, 7, 8, 9, 11, 15)`
Concept: Use of Karnaugh Map for Minimization of Boolean Expressions (Up to 4 Variables)