Worksheet 17 Answers
Worksheet 17 Answers
Question Bank
Answers
https://unacademy.com/@LovejeetArora
Chalo Sath Mil Kar kre Shuru….
1) A table ‘Student’ contains 5 rows and 4 columns initially. 2 more rows are
added and 1 more column is added . What will be the degree and
cardinality of the table student after adding these rows and columns?
i) 7, 5
ii) 5,7
iii) 5,5
iv) None of the above
Ans:- ii) 5,7
a. 15 15 15.7
b. 10 15.7 15.9
c. 10 15 15.7
d. 10 10 15.9
Ans:- a. 10 15 15.7
7) The ……… clause of SELECT query allows us to select only those rows in
the result that satisfied a specified condition.
a. WHERE
b. FROM
c. HAVING
d. LIKE
Ans:- a. WHERE
8)
Write the output of the following SQL command.
select substr(“COMPUTER”,3,4);
a. MPUT
b. PUTE
c. PU
d. MP
Ans: - a. MPUT
9)
The now() function in MySql is an example of ___________________.
a. Math function
b. Text function
c. Date Function
d. Aggregate Function
Ans :- c. Date Function
11) Give SQL command that will display the current month from the date
and time.
Ans :- MONTH( )
12) Which of the following keywords will you use in the following query to
display all the records of students whose name start with S?
a. Upper()
b. Trim()
c. Date()
d. Sum()
Ans:- d. SUM()
15)
What will be the output of the following code?
SELECT MOD(14,3);
Ans: 2
16)
What will be the result of the following query based on the table given
here.
IP /CS - My SQL Worksheet-17
Question Bank
Answers
https://unacademy.com/@LovejeetArora
Chalo Sath Mil Kar kre Shuru….
SELECT COUNT(Salary) FROM Instructor;
Ans:- COUNT(Salary)
--------------------
5
17) Write the command to delete all the data of the table ‘activity’ retaining
only structure.
Ans:- DELETE FROM ACTIVITY;
19) Write a SQL query to display date after 20 days of current date on your
system.
Ans:- SELECT CURDATE( ) + 10;
23) The command can be used to change the size of column to the
table.
Ans:- ALTER
a. 49.88
b. 49.8
c. 49.0
d. 50
Ans:- d. 50
28) Which of the following is/are not correct aggregate functions in SQL:
Ans:- c) Total( )
Ans:- ALTER
30) Write the SQL clause used to sort the records of a table.
Ans:- ORDER BY