Вы находитесь на странице: 1из 7

1.

Which command is used for taking �server side help� in MySQL command line tool
/hans
/c
/e
None of these
2Mark(s)
2. If emp_id contain the following set {9, 7, 6, 4, 3, 1, 2}, what will be the
output on execution of the given query?
SELECT emp_id
FROM person
ORDER BY emp_id;
{1, 2, , 3, 4, 6, 7, 9}ans
{2, 1, 4, 3, 7, 9, 6}
{9, 7, 6, 4, 3, 1, 2}
None of the mentioned
2Mark(s)
3. [A-Z] is used to
Match any letters between A to Zans
Match any uppercase letter
Both a and b
None of these
2Mark(s)
4. Which of the following is correct for SHOW COLUMNS syntax?
SHOW COLUMNS displays information about the columns in a given table.ans
SHOW COLUMNS displays information only for those columns for which you have some
privilege.
It also works for views
All of these
2Mark(s)
5. Which of the following statements is/are correct?
True OR true =true
True OR false= true
False OR false= false
All of the mentionedans
2Mark(s)
6. Which of the following is correct for XAMPP?
XAMPP is a free and open source cross-platform web server developed by Apache
Friends.ans
XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP (P) and Perl (P).
XAMPP provides support for creating and manipulating databases in MariaDB and
SQLite among others.
All of these
2Mark(s)
7. Is it necessary to insert the value in each column of the table?
Yes
No
Depends on the server
Depends on the usage of the table ans
2Mark(s)
8. What will be the output of the query given below?
SELECT *
FROM employee
WHERE (title=�HEAD TELLER�) AND (start_date=2013-01-24);
All columns and rows belong to table employee
All columns but only those rows which contain �HEAD TELLER� as a �title� and 2013-
01-24 as a �start_date�ans
Both a and b
None of the mentioned
2Mark(s)
9. Which of the following is correct for LIMIT in MySQL?
The LIMIT clause is used in the SELECT statement to constrain the number of rows
in a result set.
The LIMIT clause accepts one or two arguments.
The values of both arguments must be zero or positive integers.
All of these ans
2Mark(s)
10. What is the meaning of the �WHERE� clause in Mysql?
Filtering out unwanted rows from result set ans
Filtering out unwanted columns from result set
Both a and b
None of the mentioned
2Mark(s)
11. What will be the result of the following query?
WHERE TITLE=�teller� OR start_date=�2007-01-01�
The employee is a teller and was employed prior to 2007
The employee is a teller and was employed after January 1, 2007
The employee is something other than a teller but was employed prior to 2007
None of these ans
2Mark(s)
12. Consider a database name �Sanfoundry� whose attributes are intern_id (primary
key), subject.
Intern_id= {1, 2, 3, 4, 5, 6}
Subject= {sql, oop, sql, oop, c, c++}
If these are one to one relation then what will be the output of the following
query?
SELECT intern_id
FROM sanfoundry
WHERE subject NOT IN (c, c++);
{5, 6} ans
{1, 2, 3}
{3, 4}
None of the mentioned
2Mark(s)
13. What will be the result of the query given below?
SELECT emp_id,
�ACTIVE� STATUS,
emp_id * 3.14 emp_pi,
UPPER (lname) last_name
FROM employee;
emp_id, ACTIVE, emp_id * 314, UPPER(lname)
emp_id, Status, emp_pi, last_name ans
Error
None of the mentioned
2Mark(s)
14. What jobs �Query Optimizer� perform in MySQL?
Determine the efficient way to execute a query ans
Syntax errors
Permissions
All of the mentioned
2Mark(s)
15. Select the correct syntax for restoring database in MySQL?
mysqlimport -u username -p password database filename.sql
mysqlbackup -u username -p password database filename.sql
mysqlimport -u username -p password filename.sql
mysqlimport database filename.sql
2Mark(s)
16. Observe the given SQL query and choose the correct option.
select branch_name, count (distinct customer_name)
from depositor, account
where depositor.account_number = account.account_number
group by branch_id
The query is syntactically correct but gives the wrong answer
The query is syntactically wrong ans
The query is syntactically correct and gives the correct answer
The query contains one or more wrongly named clauses.
2Mark(s)
17. Who is known as the �father� of MySQL?
Michael Widenius ans
Bill Joy
Bill Gates
Stephanie Wall
2Mark(s)
18. What is the need of �column Aliases� in �SELECT� clause?
To assign a new label to the column in result set
To overwrite the existing column name in result set
To modify the column name while using literals, Expression, built_in functions
with �SELECT clause
All of the mentioned // ans
2Mark(s)
19. What will be the output of the query given below?
SELECT emp_id, fname, lname
FROM employee
WHERE title=�HEAD TELLER�;
All columns
Only those columns which are mention with �SELECT� clause
Columns mention with �SELECT� clause and only those rows which contain �HEAD
TELLER� as a �title� ans
None of the mentioned
2Mark(s)
20. What will be the output of the following query?
SELECT account_id, product_id, cust_id
FROM account
WHERE product_id IN (�sav�, �chd�, �mm�);
Only those values are selected whose product_id is either �sav�, �chd�, �mm� ans
Only those values are selected whose product_id is either �sav��
Only those values are selected whose product_id is either �sav�, �chd�
All of the mentioned
2Mark(s)
21. Which of the following is correct syntax of DISTINCT?
SELECT DISTINCT column1, column2, ... FROM table_name; ans
SELECT DISTINCT column1, column2;
Both a and b
None of these
2Mark(s)
22. Which among the following is the correct syntax for creating table?
CREATE TABLE name; ans
CREATE name;
CREATE TABLE
All of the mentioned
2Mark(s)
23. Which of the following is correct for MySql REGEXP?
REGEXP operators check whether the string matches pattern containing a regular
expression.
REGEXP are not case sensitive, except when used for with BINARY and VARBINARY data
types.
Both a and b ans
None of these
2Mark(s)
24. SQL stands for -
Simple Query Language
Structured Query Language ans
Sequential Query Language
Structural Query Language
2Mark(s)
25. _____________ converts the characters of a string to lower case characters.
STRLWR()
LOWERCASE()
LCASE() ans
TOLOWER()
2Mark(s)
26. Which of the following operators is/are used in �Condition Evaluation�?
AND
OR
NOT
All of the mentioned ans
2Mark(s)
27. Is there any error in executing the following query?
SELECT emp_id, �ACTIVE�,
emp_id * 3.145,
UPPER (lname)
FROM Employee;
Yes
NO ans
Depends on condition
None of the mentioned
2Mark(s)
28. A relation is in 1NF if it doesn't contain any ____________.
Determinants
Repeating groups ans
Null values in primary key fields
Functional dependencies
2Mark(s)
29. What will be the output of a query given below?
SELECT person_id, Fname, lname FROM person;
Show only columns (person_id, Fname, lname) and rows related to these columns ans
Show only columns (person_id, Fname, lname)
Show all rows
Show all columns except (person_id, Fname, lname)
2Mark(s)
30. ______________ returns a specified number of characters from a particular
position of a given string.
SUB()
SUBSTRING() ans
RETURN()
None of these
2Mark(s)
31. What will be the output of the following query?
SELECT account_id, product_id, cust_id
FROM account
WHERE product_id NOT IN (�sav�, �chd�, �mm�);
Only those values are selected whose product_id does not belong to either �sav�,
�chd�, �mm� ans
Only those values are selected whose product_id does not belong to either �sav��
Only those values are selected whose product_id does not belong to either �sav�,
�chd�
All of the mentioned
2Mark(s)
32. What is the significance of �ORDER BY� in the given query?
SELECT emp_id, fname, lname
FROM person
ORDER BY emp_id;
Data of emp_id will be sorted
Data of emp_id will be sorted in descending order
Data of emp_id will be sorted in ascending order ans
All of the mentioned
2Mark(s)
33. What will be the output of the query given below?
SELECT *
FROM employee
WHERE (title=�HEAD TELLER�) OR (start_date>2013-01-24);
All columns and rows belong to table employee
All columns but only those rows which contain �HEAD TELLER� as a �title� OR
start_date are greater than 2013-01-24 ans
Both a and b
None of the mentioned
2Mark(s)
34. Which of the following syntax is true?
SELECT column_name(s) FROM table_name WHERE column_name IN (value1, value2);
SELECT * FROM table_name WHERE column_name NOT IN (value1);
SELECT column_name(s) FROM table_name WHERE column_name IN (value1);
All of them ans
2Mark(s)
35. What will be the output of the query given below?
SELECT emp_id, fname, lname
FROM employee
WHERE title=�HEAD TELLER� AND start_date=2008-11-24;
All columns
Only those columns which are mention with �SELECT� clause
Columns mention with �SELECT� clause and only those rows which contain �HEAD
TELLER� as a �title� and start_date as 2008-11-24 ans
None of the mentioned
2Mark(s)
36. Find out the logical error in the following query?
CREATE TABLE person
( person_id VARCHAR(20),
Name VARCHAR (20),
Address VARCHAR (20),
Mobile_no SMALLINT
);
Lesser number of columns
Incorrect definition
Primary key is missing ans
None of the mentioned
2Mark(s)
37. The _____ aggregation operation adds up all the values of the attribute
add
avg
max
sum ans
2Mark(s)
38. What is an inner query?
A MySQL subquery ans
A MySQL query that contains the subquery
Any MySQL query
All of these
2Mark(s)
39. Join decomposition is a process of decomposing a join: running its single table
queries parts and then composing the results at the application side. Can join
decomposition give a significant performance boost or is it wasteful?
It can give efficiency in some conditions ans
It is wasteful because join decomposition increases the number of queries
Depends on the database you're using
None of these
2Mark(s)
40. Which of the following is not a built in aggregate function in SQL?
avg
max
total ans
count
2Mark(s)
41. Find the error?
SELECT *;
No Error
No table mentioned ans
Depends
None of the mentioned
2Mark(s)
42. What is the meaning of �ORDER BY� clause in Mysql?
Sorting your result set using column ans
Aggregation of fields
Both a and b
None of the mentioned
2Mark(s)
43. ____________ regular expressions use certain special constructs so that they
can match more than one string.
Nontrivial
Trivial
Both a and b
None of these
2Mark(s)
44. Which function returns the length of a given string?
LENGTH() ans
STRLEN()
STRLENGTH()
STRING_LENGTH()
2Mark(s)
45. Which of the following statement is correct for granting all privileges for all
tables in MySQL?
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
GRANT ALL PRIVILEGES ON database.table TO 'user'@'localhost'; ans
GRANT PRIVILEGES ON database.* TO 'user'@'localhost';
None of these
2Mark(s)
46. What default value gets stored in columns of the table, if it has no default
value?
NULL ans
1
-1
2Mark(s)
47. What will be the output of a query given below?
SELECT * FROM person;
Show all rows and columns of table �person� ans
Show all rows of table �person�
Show all columns of table �person�
None of the mentioned
2Mark(s)
48. What will be the output of the query given below?
SELECT *
FROM employee
WHERE title=�HEAD TELLER�;
All columns and rows belong to table employee
All columns but only those rows which contain �HEAD TELLER� as a �title� ans
Both a and b
None of the mentioned
2Mark(s)
49. Which one is the correct declaration for choosing the character set other than
default?
Varchar(20) character set utf8; ans
Varchar(20);
Varchar(20) character set;
Both a and b
2Mark(s)
50. The correct syntax to use LIMIT is -
SELECT column1,column2,...FROM table LIMIT offset , count; ans
SELECT column1,column2,...LIMIT offset , count;
Both a and b
None of thesex

Вам также может понравиться