0% found this document useful (0 votes)
5 views

MYSQL MCQ CLASS 12 IP

The document contains a series of SQL-related questions and answers covering various topics such as SQL commands, data types, aggregate functions, and query syntax. It includes multiple-choice questions that test knowledge on SQL keywords, operations, and database concepts. The content is structured in a quiz format, making it suitable for learning or assessment purposes.

Uploaded by

Deepti J Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

MYSQL MCQ CLASS 12 IP

The document contains a series of SQL-related questions and answers covering various topics such as SQL commands, data types, aggregate functions, and query syntax. It includes multiple-choice questions that test knowledge on SQL keywords, operations, and database concepts. The content is structured in a quiz format, making it suitable for learning or assessment purposes.

Uploaded by

Deepti J Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

1- What is the full form of SQL? 12- Which SQL keyword is used to retrieve a
a) Structured Query Language ​ ​ maximum value?
b) Structured Query List a) MAXIMUM​ ​ ​ b) MOST​
c) Simple Query Language​ ​ ​ c) UPPER​ ​ ​ d) MAX
d) None of these
13- What is a view?
2- Which is the subset of SQL commands used to a) A view is a special stored procedure executed
manipulate Oracle Database structures, including when a certain event occurs.
tables? b) A view is a virtual table which results of
a) Data Definition Language(DDL)​ ​ executing a pre-compiled query. A view is not
b) Data Manipulation Language(DML) part of the physical database schema, while
c) Both of above​ ​ ​ ​ the regular tables are.
d) None c) A view is a database diagram.
d) None of these
3- Which operator performs pattern matching?
a) BETWEEN operator​ b) LIKE operator 14- Which of the following SQL commands is used
c) EXISTS operator​ ​ d) None of these to retrieve data?
a) DELETE​ ​ ​ b) INSERT​
4- What operator tests columns for the absence of c) SELECT​ ​ ​ d) JOIN
data?
a) EXISTS operator​ b) NOT operator 15- Which of the following is a SQL aggregate
c) IS NULL operator​ d) None of these function?
a) LEFT b) AVG​ c) JOIN d) LEN
5- In SQL, which command(s) is(are) used to
change a table’s storage characteristics? 16- Which SQL statement is used to delete data
a) ALTER TABLE​ b) MODIFY TABLE FROM a database?
c) CHANGE TABLE​ d) All of the above a) COLLAPSE​ ​ b) REMOVE​
c) ALTER​ ​ d) DELETE
6- In SQL, which of the following is not a data
definition language commands? 17- Which SQL keyword is used to sort the
a) RENAME​ ​ b) REVOKE result-set?
c) GRANT​ ​ d) UPDATE a) SORT BY​ ​ ​ b) ORDER
c) ORDER BY​ ​ ​ d) SORT
7- In SQL, which command is used to SELECT only
one copy of each set of duplicable rows 18- Which of the following group functions ignore
a) SELECT DISTINCT​ b) SELECT UNIQUE NULL values?
c) SELECT DIFFERENT d) All of the above a) MAX​ ​ b) COUNT​ ​
c) SUM​​ ​ d) All of the above
8- A command that lets you change one or more
fields in a record is 19- What does DML stand for?
a) Insert​ ​ b) Modify a) Different Mode Level​ ​ ​
c) Look-up​ ​ d) All of the above b) Data Model Language
c) Data Mode Lane​ ​ ​ ​
9- Which of the SQL statements is correct? d) Data Manipulation Language
a) SELECT Username AND Password FROM Users
b) SELECT Username, Password FROM Users 20- The __________clause of the SELECT query
c) SELECT Username, Password WHERE Username allows us to select only those rows in the results
= ‘user1’ that satisfy a specified condition.
d) None of these a) Where​ ​ ​ b) from​
c) having​ ​ ​ d) like
10- The FROM SQL clause is used to…
a) specify what table we are selecting or deleting 21- Which of the following functions is used to
data FROM FIND the largest value from the given data in
b) specify range for search condition MYSQL?
c) specify search condition a) MAX ()​ ​ ​ b) MAXIMUM ()
d) None of these c) LARGEST ()​​ ​ d) BIG ()
11- Which SQL keyword is used to retrieve only 22- The data types CHAR (n) and VARCHAR (n) are
unique values? used to create _______ and _______ types of
a) DISTINCTIVE​ ​ b) UNIQUE​ string/text fields in a database.
c) DISTINCT​ ​ d) DIFFERENT a) Fixed, equal​ b) Equal, variable​
2
c) Fixed, variable​ d) Variable, equal d) SELECT city, temperature FROM weather
23- The term ___________ is used to refer to a record ORDER BY city;
in a table.
a) Attribute​ ​ ​ b) Tuple​ 34- In SQL, which command is used to SELECT
c) Row​ ​ ​ ​ d) Instance only one copy of each set of duplicable rows
a) SELECT DISTINCT​ b) SELECT UNIQUE​
24- A relational database consists of a collection of c) SELECT DIFFERENT d) All of the above
a) Tables​ ​ ​ b) Fields​
c) Records​ ​ ​ d) Keys 35- Which of the following is a SQL aggregate
function?
25- What is the full form of DDL? a) LEFT b) AVG c) JOIN ​ d) LEN
a) Dynamic Data Language​ ​ ​
b) Detailed Data Language 36- The command used for modifying the records
c) Data Definition Language​ ​ ​ is:
d) Data Derivation Language a) update b) add c) updateall d) none of the
above
26- A(n) in a table represents a logical relationship
among a set of values. 37- An attribute in a relation is foreign key if it is
a) Attribute​ b) Key ​ c) Tuple d) Entry the _________key in any other relation.
a) Candidate​ b) Primary c) Super ​d) Sub
27- The term ____________ is used to refer to a field
in a table. 38- Which of the following sublanguages of SQL is
a) Attribute​ b) Tuple c) Row d) Instance used to query information from the database and to
insert tuples into, delete tuples from, and modify
28- Consider the following query tuples in the database?
a) DML (Data Manipulation Language)
SELECT name FROM stu WHERE subject LIKE b) DDL (Data Definition Language)
‘_______ Computer Science’; c) Query d) Relational Schema
Which one of the following has to be added into the 39- By default, the ORDER BY clause lists the
blank space to select the subject which has results in _______ order.
Computer Science as its ending string? a) Descending b) Any c) Same d) Ascending
a) $​ b) _​ c) ||​ d) %
40- Which of the following attributes can be
29- Consider the following SQL statement. What considered as a choice for primary key?
type of statement is this? a)Name b)Street​ c) Roll No​ d) Subject
SELECT * FROM employee
41- In the given query which keyword has to be
a) DML​ b) DDL c) DCL d) Integrity constraint inserted?
INSERT INTO employee______(1002, “Kausar”,
30- Which of the following functions is not an 2000);
aggregate function? a) Table b) Values​ c) Relation d) Field
a) Round()​ b) Sum() c) Count ()​ d) Avg ()
42. What SQL statement do we use to display the
31- Pick the correct username used for logging in record of all students whose last name contains 5
the database (sql with Python). letters ending with “A”?
a) root​ b) local c) directory d) host a) SELECT * FROM STUDENTS WHERE LNAME
LIKE ‘_ _ _ _A’;
32- Aggregate functions can be used in the select b) SELECT * FROM STUDENTS WHERE LNAME
list or the _____ clause of a select statement. They LIKE ‘ _ _ _ _ _’;
cannot be used in a ______ clause. c) SELECT * FROM STUDENTS WHERE LNAME
a) Where, having​ b) Having, where​ LIKE ‘ ????A’;
c) Group by, having d) Group by, where d) SELECT * FROM STUDENTS WHERE LNAME
LIKE ‘*A’;
33- Select correct SQL query from below to find the
temperature in increasing order of all cities. 43- Consider the table with structure as:
a) SELECT city FROM weather ORDER BY Student (ID, name, dept name, tot_cred)
temperature; In the above table, which attribute will form the
b) SELECT city, temperature FROM weather; primary key?
c) SELECT city, temperature FROM weather a)Name b) Dept c) total_credits d) ID
ORDER BY temperature;
3
44- Which of the following will you use in the 52- SQL applies conditions on the groups through
following query to display the unique values of the _____ clause after groups have been formed,
column dept_name? a) Group by b) With c) Where d) Having
SELECT _____________ dept_name FROM Company;
a)All b) From c) Distinct d) Name 53- To execute all the rows from the result set,
which method is used?
45- Consider the following query: a) fetchall​ ​ b) fetchone
SELECT name, instructor name, course______id c) fetchmany​ ​ d) none of the above
FROM instructor;
To display the field heading course with a different 54- What is the meaning of the “HAVING” clause in
heading as id, which keyword must be used here to the SELECT query?
rename the field name? a) To filter out the summary groups
a)From b) Rename c) As d) Join b) To filter out the column groups
c) To filter out the row and column values
46. With SQL, how do you select all the records d) None of the mentioned
from a table named “Students” where the value of
the column “FirstName” ends with an “a”? 55- Which of the following queries contains an
a) SELECT * FROM Students WHERE FirstName error?
=’a’; a) Select * from emp where empid = 10003;
b) SELECT * FROM Students WHERE FirstName b) Select empid from emp where empid=10006;
LIKE ‘a%’; c) Select empid from emp;
c) SELECT * FROM Students WHERE FirstName d) Select empid where empid=1009 and
LIKE ‘%a’; lastname=’GUPTA’;
d) SELECT * FROM Students WHERE FirstName
=’%a%’; 56- Which operator tests the column for the
absence of data (i.e., NULL value) ?
47. The HAVING clause does which of the a) EXISTS operator​ ​ b) NOT operator
following? c) IS operator​ ​ ​ d) None of these
a) Acts EXACTLY like WHERE clause
b) Acts like a WHERE clause but is used for 57- Consider the following query:
columns rather than groups. SELECT name FROM class WHERE
c) Acts like a WHERE clause but is used form subject_____NULL;
groups rather than rows. Which comparison operator may be used to fill the
d) Acts like a WHERE clause but is used for rows blank space in the above query?
rather than columns. a) =​ b) LIKE​ c) IS/IS Not​ d) if
48- Which clause is used with “aggregate 58- Which SQL function is used to count the
functions”? number of rows in a SQL query?
a) GROUP BY b) SELECT a) COUNT ()​ ​ b) NUMBER ()
c) WHERE d) Both (a) and (b) c) SUM ()​ ​ d) COUNT (*)
49- To open a connector to Mysql database, which 59- With SQL, how can you return the number of
statement is used to connect with mysql? not null records in the Project field of the
a) Connector ​ b) Connect “Students” table?
c) password​ ​ d) username a) SELECT COUNT (Project) FROM Students;
b) SELECT COLUMNS (Project) FROM Students;
50- If column “Marks” contains the data set {25, c) SELECT COLUMNS (*) FROM Students;
35, 25, 35, 38}, what will be the output after the d) SELECT COUNT (*) FROM Students;
execution of the given query?
SELECT MARKS (DISTINCT) FROM STUDENTS; 60- Which of the following is not an aggregate
a) 25, 35, 25, 35, 38​ ​ b) 25, 25, 35, 35 function?
c) 25, 35, 38​ ​ ​ d) 25, 25, 35, 35 a) Avg b) Sum c) With d) Min
51- If column “Salary” contains the data set {1000, 61- All aggregate functions except _______ ignore
15000, 25000, 10000, 15000}, what will be the null values in their input collection.
output after the execution of the given query? a) Count (attribute​ ​ b) Count (*)
SELECT SUM(DISTINCT SALARY) FROM c) Avg​ ​ ​ ​ d) Sum
EMPLOYEE;
a)75000 b) 25000 c) 10000​ d) 50000 62- Which of the following group functions ignore
NULL values?
a) MAX​ b) COUNT c) SUM d) All of the above
4
63- What will be the order of the data being sorted
after the execution of given query
SELECT * FROM STUDENT ORDER BY ROLL_NO;
a)Custom Sort​​ ​ b) Descending
c) Ascending​ ​ ​ d) None of the above
64- Where and Having clauses can be used
interchangeably in SELECT queries?
a) True​ ​ ​ ​ b) False
c) Only in views ​ ​ d) With order by
65- A______ is property of the entire relation, which
ensures through its value that each tuple is unique
in a relation.
a) Rows b) Key c) Attribute d) fields
66- The operation whose result contains all pairs of
tuples from the two relations, regardless of whether
their attribute values match.
a) Join ​ ​ ​ b) Cartesian product
c) Intersection​​ ​ d) Set difference
67- Consider the following SQL statement. What
type of statement is this?
CREATE TABLE employee (name VARCHAR, id
INTEGER);
a) DML b) DDL c) DCL d) Integrity constraint
68- The pattern ‘- – – ’ matches any string of
________ three characters. ‘- – – %’ matches any
string of ____ three characters.
a) Atleast, Exactly​ ​ b) Exactly, Atleast
c) Atleast, All​ ​ ​ d) All, Exactly
**********************

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy