0% found this document useful (0 votes)
209 views67 pages

Chapter 6 Database

The document discusses database management concepts through multiple choice questions. It covers topics like data constraints, database queries, keys, relations, attributes and more. The document contains 15 multiple choice questions to test knowledge and understanding of relational databases and SQL.

Uploaded by

Hemnathpalani
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)
209 views67 pages

Chapter 6 Database

The document discusses database management concepts through multiple choice questions. It covers topics like data constraints, database queries, keys, relations, attributes and more. The document contains 15 multiple choice questions to test knowledge and understanding of relational databases and SQL.

Uploaded by

Hemnathpalani
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/ 67

Name of the Chapter-DATABASE MANAGEMENT

Sl. Question: Learning Objective


No
1. A data ________ is a restriction or limitation to ensure accuracy and Understanding
reliability of data in database
(A) Constraint
(B) Dictionary
(C) Query
(D) None of these
2. A _________is a type of command that retrieves data from a database Understanding
on a server
(A) Constraint
(B) Dictionary
(C) Query
(D) None of these
3. RDBMS stands for Knowledge
(A) Relational Database Management System
(B) Rotational Database Management System
(C) Reliable Database Management System
(D) None of these
4. An attribute or set of attributes that is used to uniquely identify a Understanding
record in a database table is called
(A) A primary key
(B) An identifier
(C) A tuple
(D) None of the above
5 A primary key consisting of more than one attribute is called Creation
(A)Composite Primary Key
(B)Foreign Key
(C)Alternate Key
(D)None of these

6. Each row of data in a relation(table) is called Understanding


(A) attribute
(B) tuple
(C) domain
(D) None of these
7. Column headings in a relation are referred as Understanding
(A) attributes
(B) tuples
(C) domains
(D) None of these
8. ______________ is a set of values from which an attribute can take a Understanding
value in each row
(A) Attribute
(B) Tuple
(C) Domain
(D) None of these
9. The number of attributes in a relation is called the ___________ of Understanding
the relation
(A)Degree
(B) Cardinality
(C) Domain
(D) None of these
10. The number of tuples in a relation is called the ___________ of the Understanding
relation
(A)Degree
(B) Cardinality
(C) Domain
(D) None of these
11. A _________ is used to represent the relationship between two Application
relations. (A)Composite Key
(B)Foreign Key
(C)Alternate Key
(D)None of these
12. An attribute or set of attributes that can be served as a primary key of Understanding
a relation is called
(A)Service Key
(B)Foreign Key
(C)Candidate Key
(D)None of these

13. A candidate key that is not the primary key is called Understanding
(A)Composite Key
(B)Foreign Key
(C)Alternate Key
(D)None of these
14. In relational model, tables are called Understanding
(A) Domains
(B) Relations
(C) Tuples
(D) None of these
15 ___________ can take NULL values in it Knowledge
(A)Primary Key
(B)Foreign Key
(C)Both Primary Key and Foreign Key
(D)None of these

Answers
Multiple Choice question
Q.No.1 (A) Constraint
Q.No.2 (C) Query
Q.No.3 (A)Relational Database Management System
Q.No.4 (A) A primary key
Q.No.5 (A)Composite Primary Key
Q.No.6 (B) tuple
Q.No.7 (A) attributes
Q.No.8 (C) Domain
Q.No.9 (A)Degree
Q.No.10 (B) Cardinality
Q.No.11 (B)Foreign Key
Q.No.12 (C)Candidate Key
Q.No.13 (C)Alternate Key
Q.No.14 (B) Relations
Q.No.15 (B)Foreign Key

MCQ QUESTIONS
Sl. Question: Learning
No Objective
1 A relational database consists of a collection of Knowledge
(A) Tables
(B) Fields
(C) Records
(D) Keys
2 A/An ____________ in a table represents a logical relationship among a set of Knowledge
values.
(A) Attribute
(B) Key
(C) Tuple
(D) Entry
3 The term _________ is used to refer to a record in a table. Knowledge
(A) Attribute
(B) Tuple
(C) Field
(D) Instance
4 The term _________ is used to refer to a record in a table. Knowledge
(A) Attribute
(B) Tuple
(C) Field
(D) Instance
5 Which of the following attributes cannot be considered as a choice for primary Understanding
key?
(A) Id
(B) License Number
(C) Dept_Id
(D) Street
6 An attribute in a relation is a foreign key if it is the ___________ key in any other Knowledge
relation.
(A) Candidate
(B) Primary
(C) Super
(D) Sub
7 Consider the table with structure as : Understanding
Student (ID, name, dept_name, tot_cred)
In the above table, which attribute will form the primary key?
(A) Name
(B) Dept
(C) Total_credits
(D) ID
8 Which one of the following is commonly used to define the overall design of the Knowledge
database?
(A) Application program
(B) Data definition language
(C) Schema
(D) Source code
9 Which of the following keys is generally used to represents the relationships Understanding
between the tables?
(A) Primary key
(B) Foreign key
(C) Secondary key
(D) None of the above
10 For what purpose the DML is provided? Understanding
(A) Addition of new structure in the database
(B) Manipulation & processing of the database
(C) Definition of the physical structure of the database system
(D) All of the above
11 The term "SQL" stands for Knowledge
(A) Standard query language
(B) Sequential query language
(C) Structured query language
(D) Server-side query language
12 Which of the following data type will be suitable for storing the name of students? Understanding
(A) int
(B) varchar(n)
(C) char
(D) None of the above

13 What is the format used for storing date using date datatype? Knowledge
(A) dd-mm-yy
(B) dd-mm-yyyy
(C) mm-dd-yyyy
(D) yyyy-mm-dd
14 Which of the following constraints can be used if we don’t want user to leave the Understanding
field blank while inserting data?
(A) “NULL”
(B) not null
(C) “Unassigned”
(D) unique key
15 Which of the following data type will be the best choice for storing price of any Understanding
item?
(A) string
(B) int
(C) date
(D) float

Multiple Choice question


Q.No.1 A
Q.No.2 C
Q.No.3 B
Q.No.4 B
Q.No.5 D
Q.No.6 B
Q.No.7 D
Q.No.8 C
Q.No.9 B
Q.No.10 B
Q.No.11 C
Q.No.12 B
Q.No.13 D
Q.No.14 B
Q.No.15 D

Sl. Question: Learning


No Objective
1. A relational database consists of a collection of Knowledge
A. Tables
B. Fields
C. Records
D. Keys

2. Which of the following is NOT a DML command? Knowledge


A. SELECT
B. DELETE
C. UPDATE
D. DROP

3. Identify the correct command SQL query which is expected to delete Knowledge
all rows of a table TEMP without deleting its structure ?

A. DELETE TABLE TEMP;


B. DROP TABLE TEMP;
C. REMOVE TABLE TEMP;
D. DELETE FROM TEMP;
4. Which is not a constraint in SQL? Knowledge

(A) Unique
(B) Distinct
(C) Primary key
(D) d. Check

5. For each attribute of a relation, there is a set of permitted values, called the Knowledge
………. of that attribute.
(A) Dictionaries
(B) Domain
(C) Directory
(D) d. Relation
6. _____key is used to join two relations in RDBMS? Knowledge
(A) Primary Key
(B) Candidate Key
(C) Foreign Key
(D) Unique Key
7. What is the degree and cardinality of a SQL table? Knowledge

(A) Number of columns and Number of rows


(B) Number of rows and Number of columns
(C) Number of keys and Number of constraints
(D) None
8. ................... command helps to fetch data from relation. Knowledge

(A) Use
(B) Show
(C) Fetch
(D) Select
9. A .................. is a text that is not executed. Knowledge

(A) Statement
(B) Query
(C) Comment
(D) Clause
10. .................. command helps to open the database for use. Knowledge

(A) Use
(B) Open
(C) Distinct
(D) Select
11. If you want to add a new column in an existing table, which command is Creation
used. For example, to add a column bonus in a table emp, the statement
will be given as:
(A) ALTER table emp ADD (bonus Integer);
(B) CHANGE table emp ADD bonus int;
(C) ALTER table emp ADD bonus int;
(D) UPDATE table emp ADD bonus int;
12. What is the full form of SQL? Knowledge

(A) Structured Query Language


(B) Structured Query List
(C) Simple Query Language
(D) Data Derivation Language
13. The __________clause of SELECT query allows us to select only those Knowledge
rows in the results that satisfy a specified condition.

(A) Where
(B) from
(C) having
(D) like
14. Which is the subset of SQL commands used to manipulate database Knowledge
structure including tables?

(A) Data Definition Language (DDL)


(B) Data Manipulation Language (DML)
(C) Both (a) and (b)
(D) None
15. The term ____________ is used to refer to a field in a table. Knowledge

(A) Attribute
(B) Tuple
(C) Row
(D) Instance

Multiple Choice question


Q.No.1 Tables
Q.No.2 DROP
Q.No.3 DELETE FROM TEMP;
Q.No.4 Distinct
Q.No.5 Domain
Q.No.6 Foreign Key
Q.No.7 Number of columns and Number of rows
Q.No.8 Select
Q.No.9 Comment
Q.No.10 Use
Q.No.11 ALTER table emp ADD bonus int;
Q.No.12 Structured Query Language
Q.No.13 Where
Q.No.14 Data Definition Language
Q.No. 15 Attribute

Sl. Question: Learning


No. Objective
1 Which is the subset of SQL commands used to manipulate Database structures, Knowledge
including tables?
a) Data Definition Language(DDL)
b) Data Manipulation Language(DML)
c) Both of above
d) None
2 This SQL query selects Understandi
ng
SELECT name
FROM Emp
WHERE salary IS NOT NULL;
a) Tuple with null values
b) Tuples with no null values
c) Tuples with any salary
d) All of the above
3 What is the full form of SQL? Knowledge
a) Structured Query Language
b) Structured Query List
c) Simple Query Language
d) None of these
4 What does DML & DDL stands for? Knowledge
a) Data Manipulation Language (DML) & Data Definition Language (DDL)
b) Data Mode Lane (DML) & Data Definition Language (DDL)
c) Different Mode Level (DML) & Data Derivation Language (DDL)
d) Data Model Language (DML) & Dynamic Data Language (DDL)

5 Which of the following sublanguages of SQL is used to define the structure of the Understandi
relation, deleting relations and relating schemas ? ng
a) Data Definition Language (DDL)
b) Data Manipulation Language (DML)
c) Query
d) Relational Databases
6 Consider the following SQL statement. What type of statement is this? Understandi
ng
SELECT * FROM Employee ;
a) DML
b) DDL
c) DCL
d) Integrity Constraint
7 Consider the following SQL statement. What type is this ? Understandi
ng
DROP TABLE items;
a) DML
b) DDL
c) DCL
d) TCL
8 The data types CHAR (n) and VARCHAR (n) are used to create ___________ Knowledge
and __________ length types of string/text fields in a database.
a) Fixed, Equal
b) Equal, Variable
c) Fixed, Variable
d) Variable, Equal
9 Which of the following is/are the DDL statements ? Knowledge
a) Create
b) Drop
c) Alter
d) All of these
10 ___________ defines rules regarding the values allowed in columns and is the Knowledge
standard mechanism for enforcing database integrity.
a) Column
b) Constraint
c) Index
d) Trigger
11 To define a column as a primary key, ____________ _____________ constraint is Knowledge
used in CREATE TABLE.
a) primary word
b) primary keynote
c) candidate key
d) primary key

Multiple Choice question


Q.No. 1 Answer : c) Both of above
Q.No. 2 Answer : b) Tuples with no null values
Q.No. 3 Answer : a) Structured Query Language
Q.No. 4 Answer : a) Data Manipulation Language (DML) & Data Definition Language (DDL)
Q.No. 5 Answer : a) Data Definition Language (DDL)
Q.No. 6 Answer : a) DML
Q.No. 7 Answer : b) DDL
Q.No. 8 Answer : c) Fixed, Variable
Q.No. 9 Answer : d) All of these
Q.No.10 Answer : b) Constraint
Q.No.11 Answer : d) primary key

Sl.No Question: Learning


Objective
1. Which command we use to create a database in MySQL. Knowledge
a) Select database from MySQL;
b) Create database databasename;
c) Use databasename;
d) Update database;

2. Sonia wants to see all the databases are available in her MySQL software. Understanding
Which command is useful for her?
a) Show databases;
b) Show database;
c) Show tables
d) Show database_name;

3. Goni wants to do some work with her database. She is confused about how to Application
write commands to use the required database. Choose correct option
a) Required database;
b) Use database;
c) Use <databasename>;
d) Required <databasename>
4. To delete a database _________________command is used Application
a) Delete database database_name
b) Delete database_name
c) Drop database database_name
d) Drop database_name

5 To show all the tables of a given database what will be the command? Analysis
a) Use database_name; shows tables;
b) Use database_name; show tables;
c) Required database; show tables;
d) Required database; shows tables;

6. Consider the following SQL statement. What type of statement is this? Analysis
CREATE TABLE employee (name VARCHAR, id INTEGER)
​(a) DML
​(b) DDL
​(c) DCL
​(d) Integrity constraint

7. Which among the following is the correct syntax for creating tables? Analysis
a) CREATE TABLE name;
b) CREATE name;
c) CREATE TABLE
d) All of the mentioned
8. Which command shows the table structure of table emp? Understanding
a) Select * from emp;
b) Show all from emp;
c) Desc emp;
d) Drop emp;
9. Which of the following functions are not performed by the “ALTER” clause? Understanding
a) Change the name of the table
b) Change the name of the column
c) Drop a column
d) All of the mentioned
10. The __________clause of SELECT query allows us to select only those rows Application
in the results that satisfy a specified condition.

(a) Where
(b) from
(c) having
(d) like

11. Which command is used to change the definition of a table in SQL? Understanding
a) create
b) update
c) alter
d) delete
12. Which command to use in order to delete the data inside the table, and not the Understanding
table itself

A) DELETE
B) TRUNCATE
C) Both TRUNCATE & DELETE
D) DROP
13 In the given query which keyword has to be inserted? Application
INSERT INTO employee______(1002, “Kausar”, 2000);
​(a) Table
​(b) Values
​(c) Relation
​(d) Field
14. Which SQL statement is used to delete specific data FROM a database? Understanding
a) Drop
b) Remove
c) Alter
d) delete

15. Consider the following SQL statement. What type of statement is this? Knowledge
SELECT * FROM employee
​(a) DML
​(b) DDL
​(c) DCL
​(d) Integrity constraint

Multple Choice question


Q.No. Answer
1 a) Create database databasename;

2 a) Show databases;
3 (c ) Use <databasename>;

4 a) Delete database database_name

5 (b)Use database_name; show tables;

6 (b) DDL
7 (a) CREATE TABLE name;
8 a) Desc emp;
9 (d) All of the mentioned
10 (a) Where
11 ( c) alter
12 (D) DROP
13 (b) Values
14 (d) delete
15 (a) DML

MCQ QUESTIONS
Sl. No. Question: Learning
Objective
1. Which operator is used to compare a value to a specified list of values? Rememb
A. Between ering &
B. All Understa
C. In ding
D. None of the above

2. You can change/modify value for one or more columns of a table using SQL with Rememb
which of the following? ering &
A. Change Understa
B. Modify ding
C. Alter
D. Update

3. Which operator checks column for non existence of data in that column Rememb
A. NOT Operator ering &
B. Exists Operator Understa
C. IS NULL Operator ding
D. None of the above

4. Using a WHERE clause in a SQL query is used to specify SQL reserved words and Rememb
characters, known as ____? ering &
A. Operators Understa
B. Data Types ding
C. Numbers
D. Syntax
5. Using which SQL Comparison Operator can we find the data that matches our Rememb
query? ering &
A. SQL Not Equal Operator (!=) Understa
B. SQL Equal Operator (=) ding
C. SQL Greater Than Operator (>)
D. SQL Less Than Operator (<)
6. Which of the following is not a SQL Logical Operator? Rememb
A. SQL Equal Operator ering &
B. SQL ANY Operator Understa
C. SQL BETWEEN Operator ding
D. SQL IN Operator
7. The SQL Modulus Operator returns the, Rememb
A. Quotient ering &
B. Percentage Understa
C. Sum ding
D. Reminder
8. SQL Division operator divides the operand on the ____ side by the operand on the Applying
____ side.
A. Left, Left
B. Right, Left
C. Left, Right
D. Right, Right
9. If we have not specified ASC or DESC after a SQL ORDER BY clause, the Analysin
following is used by default g,
A. DESC Evaluatin
B. ASC g and
C. There is no default value Creating
D. None of the mentioned
10. Which of the following is true about the SQL AS clause? Rememb
A. The AS clause in SQL is used to change the column name in the output or ering &
assign a name to a derived column. Understa
B. The SQL AS clause can only be used with the JOIN clause. ding
C. The AS clause in SQL is used to defines a search condition.
D. All of the mentioned
11. When the wildcard in a WHERE clause is useful? Rememb
A. When an exact match is required in a SELECT statement. ering &
B. When an exact match is not possible in a SELECT statement. Understa
C. When an exact match is required in a CREATE statement. ding
D. When an exact match is not possible in a CREATE statement.
12. Select the correct order of precedence among the following? Rememb
1. OR > NOT > + > ** ering &
2. NOT > OR > ** > + Understa
3. ** > + > OR > NOT ding
4. ** > + > NOT > OR
13. The SQL keyword(s) ________ is used with wildcards. Rememb
A. LIKE only ering &
B. IN only Understa
C. NOT IN only ding
D. IN and NOT IN
14. The numerical values of two ___ of the ___ table can be easily subtracted using Rememb
SQL Subtraction Operator.
ering &
A. Rows, same
Understa
B. Columns, same
ding
C. Rows, different
D. Columns, different
15. Which of these is not correct set of Logical operators? Rememb
A. And, Or, Not, Like, Any, Between, All
ering &
B. And, Or, Not, Like, Any, Between,Where
Understa
C. And, Or, Not, Like, With, Between, Where
ding
D. And, Or, Null, Like, Any, Between, Distinct

MultpleChice question
Q.No. Answer
1. C

2. D

3. C

4. A

5. B
6. A

7. D

8. C

9. B

10. A

11. B

12. D

13. A

14. B

15. A

MCQ
QUESTION ANSW
ER
1 Which of the following function is used to FIND the largest value from the given data in MYSQL? (a)
(a) MAX() (b) MAXIMUM() (c) LARGEST() (c) BIG()
2 Aggregate functions can be used in the select list or the _____ clause of a select statement. They cannot be (b)
used in a ______ clause.
(a) Where, having(b) Having, where(c) Group by, having (d) Group by, where
3 Which of the following is a SQL aggregate function? (b)
(a) LEFT(b) AVG (c) JOIN (d) LEN
4 An attribute in a relation is foreign key if it is the _________key in any other relation. (b)
(a) Candidate (b) Primary (c) Super (d) Sub
5 The HAVING clause does which of the following? (c)
(a) Acts EXACTLY like WHERE clause
(b) Acts like a WHERE clause but is used for columns rather than groups.
(c) Acts like a WHERE clause but is used form groups rather than rows.
(d) Acts like a WHERE clause but is used for rows rather than columns.
6 Which SQL function is used to count the number of rows in a SQL query? (d)
(a) COUNT () (b) NUMBER () (c) SUM () (d) COUNT (*)
7 With SQL, how can you return the number of not null record in the Project field of “Students” table? (a)
(a) SELECT COUNT (Project) FROM Students
(b) SELECT COLUMNS (Project) FROM Students
(c) SELECT COLUMNS (*) FROM Students
(d) SELECT COUNT (*) FROM Students
8 Which of the following is not an aggregate function? (c)
(a) Avg (b) Sum (c) Sub (d) Min
9 If column “Salary” contains the data set {1000, 15000, 25000, 10000, 15000}, what will be the (d)
output after the execution of the given query?
SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;
(a)75000 (b) 25000 (c) 10000 (d) 50000
10 Which of the following group functions ignore NULL values? (d)
(a) MAX (b) COUNT (c) SUM (d) All of the above
11 Where and Having clauses can be used interchangeably in SELECT queries? (b)
(a) True (b) False (c) Only in views (d) With order by
12 The operation whose result contains all pairs of tuples from the two relations, regardless of whether their (b)
attribute values match.
(a) Join (b) Cartesian product (c) Intersection (d) Set difference
13 To specify filtering condition for groups, the _____________ clause is used in MYSQL. (b)
(a) where (b) having (c) order by (d) both a and b
14 _________ clause is used to collect those rows that have the same value in a specified column. (d)
(a) order by (b) like (c) having (d) group by
15 The SQL built-in function __________ computes the number of rows in a table. (a)
(a) count(*) (b) count(Column name) (c) sum(column) (d) both a and b

Sl. Question Learning


No. Objective
1 We apply the aggregate function to a group of sets of tuples using the _______ Remembering

clause. and

a) group by understanding

b) group
c) group set
d) group attribute
2 Choose the correct option regarding the query Applying

SELECT branch_name, COUNT (DISTINCT customer_name)


FROM depositor, account
WHERE depositor.account_number = account.account_number
GROUP BY branch_id
HAVING avg(balance) = 10000;

a) The having clause checks whether the query result is true or not
b) The having clause does not check for any condition
c) The having clause allows only those tuples that have average balance 10000
d) None of the mentioned
3 The _____ aggregation operation adds up all the values of the attribute Remembering
and
a) add understanding

b) avg
c) max
d) sum

4 What values does the count(*) function ignore? Remembering


and
a) Repetitive values understanding

b) Null values
c) Characters
d) Integers

5 Which join is equivalent to Cartesian Product? Remembering

a) INNER JOIN and

b) OUTER JOIN understanding

c) CROSS JOIN
d) NATURAL JOIN
6 How many tables may be included with a join? Applying

a) One
b) Two
c) Three
d) All of the Mentioned
7 Analysing,
Evaluating and
Creating

Above image depicts:


a) Outer Join
b) Inner Join
c) Self Join
d) Right Outer Join

8 Which of the following is not an aggregate function? Remembering

a) avg and

b) sum understanding

c) With
d) min

9 The HAVING clause does which of the following? Remembering

a) Acts EXACTLY like a where clause and

b) Acts like a WHERE clause but is used for columns rather than groups. understanding

c) Acts like a WHERE clause but is used for group rather than rows.
d) Acts like a WHERE clause but is used for rows rather than columns.

10 What is the meaning of “HAVING” clause in SELECT query? Remembering

a) To filter out the summary groups and

b) To filter out the column groups understanding

c) To filter out the row and column values


d) None of the above

11 The following SQL is which type of join? Analysing,

SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, Evaluating and

NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T WHERE Creating

CUSTOMER_T. CUSTOMER_ID = ORDER_T. CUSTOMER_ID


a) Equi-join
b) Natural join
c) Outer join
d) Cartesian join

12 Which clause is used with “aggregate functions”? Remembering

a) GROUP BY and

b) SELECT understanding

c) WHERE
d) Both (a) & (b)

13 Select the correct query/queries for cross join: Analysing,

a)Select * FROM Table1 T1 NATURAL JOIN Table1 T2; Evaluating and

b)Select * FROM Table1 T1 ALL CROSS JOIN Table1 T2; Creating

c)Select * FROM Table1 T1,Table1 T2;


d)Select * FROM Table1 T1 CROSS Table1 T2;

14 SQL applies conditions on the groups through _____________ clause after groups Remembering

have been formed. and

a) Group by understanding

b) With
c) Where
d) Having

15 The following SQL is which type of join: SELECT CUSTOMER_T. Applying

CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID FROM


CUSTOMER_T,ORDER_T WHERE CUSTOMER_T. CUSTOMER_ID =
ORDER_T. CUSTOMER_ID?
a) Equi-join
b) Natural join
c) Outer join
d) Cartesian join
KEY/ANSWER SHEET
Multiple Choice question
Q.No.1 a
2 c
3 d
4 b
5 c
6 d
7 b
8 c
9 c
10 a
11 a
12 a
13 c
14 d
15 a

INTERFACE WITH PYTHON

Sl.N Question: Learning


o Objective
1 Which my sql driver you need to install for connection of Python With MYSQL Knowledge
(A) mysql-connector
(B) mysql.connector
(C) mysql-connect
(D) All of the above
2 What is the maximum number of parameters that can be accepted by connect Understandin
method. g
(A) 2
(B) 3
(C) 1
(D) 0
3 The ………. creates a connection to the MySQL server and returns a Knowledge,
Connection object.
(A) connect()
(B) connection()
(C) connector()
(D) None of the above
4 Python enables Python programs to access MySQL databases Knowledge,
(A) import mysql.connect
(B) import mysql.connector
(C) import mysql.connection
(D) None of the above

5 A session between the application program and the database is also termed as Understandin
____ g
(A) bridge
(B) connection
(C) gap
(D) none of the above
6 The -------------------- constructor creates a connection to the MySQL server and Knowledge,
returns a MySQL Connection object.
(A) connect()
(B) connection()
(C) mysqlconnect()
(D) None of the above
7 Choose the correct statement to connect database from Python code, is host is Understandin
“localhost”, user= “root” the database is “School” with no password . g
(A) connect(host= “localhost”,user= “root”, database = “School”)
(B) connect(host= “localhost”,user= “sql”,password=NAN, database = “root”)
(C) connect(host= “host”,user= “root”,password=np.nan, database = “School”)
(D) connect(host= “loca”,user= “School”,password=“ ”, database = “root”)
8 It acts as middleware between MYDSQL database connection and SQL query. Application
(A) cursor
(B) Table
(C) Query
(D) row
9 Suresh is trying to fetch only one record from result set at a time. Which method Application
should be used by him?
(A) fetchmany
(B) fetchno
(C) fetchone
(D) fetchall
10 SQL command is passed to which function to run after establishment of the Knowledge,
connection between python and database
(A) cursor()
(B) execute()
(C) connection()
(D) fetchall()
11 Which of the following function is used to close the connection between python Knowledge,
and database?
(A) cursor.close()
(B) is.close()
(C) connection.close()
(D) execute.close()
12 Read the following code and assume that all necessary files are already Application
imported
Mycon = sql.connect(host= “localhost”,user= “root”,password=“india”,
database = “company”)
Cursor = mycon.cursor()
Query = “Select * from empl”
Which will be the next statement to execute query?
(A) Cursor.query.excute()
(B) Cursor.execute(Query)
(C) Query.execute()
(D) execute(Query)
13 When we run <connection>.__________ method, it reflect the changes made in Analysis
the database permanently.
(A) done()
(B) commit()
(C) reflect()
(D) final()
14 Which function retrieve all (remaining ) rows of a query result an return them Application
in a list of tuples
(A) fetchone()
(B) fetchall()
(C) fetchmany ()
(D) All the above
15 Which is the correct statement about fetchone() Analysis
(A) Fetch the next row of a query result set, returning a single tuple, or None
when no more data is available
(B) Fetch the First row of a query result set, returning a single tuple, or None
when no more data is available
(C) Fetch the current row of a query result set, returning a single tuple, or None
when no more data is available
(D) None of the above

Multiple-choice question
Q.No.1 (A) mysql-connector
Q.No.2 (D) 0
Q.No.3 (A) connect()
Q.No.4 (B) import mysql.connector
Q.No.5 (A) bridge
Q.No.6 (A) connect()
Q.No.7 (A) connect(host= “localhost”,user= “root”,password=“india”, database =
“School”)
Q.No.8 (A) cursor
Q.No.9 (C) fetchone
Q.No.10 (B) execute()
Q.No.11 (C) conection.close()
Q.No.12 ( c) Cursor.execute(Query)
Q.No.13 (B) commit()
Q.No.14 (B) fetchall()
Q.No.15 (A)Fetch the next row of a query result set, returning a single tuple, or None
when no more data is available

Sl. No. Question Learning


Objective

1 What is the datatype of the row returned from a resultset using fetchone() function?
a) Tuple b) List c) String d) Dictionary Knowledge

2 What is the datatype of the row returned from a resultset using fetchall() function?
a) Tuple b) List c) String d) Dictionary
Knowledge

3 What is the datatype of the row returned from a resultset using fetchmany() function?
a) Tuple b) List c) String d) Dictionary
Knowledge

4 What is returned when we execute the function fetchone() but no rows are available to
fetch ? Knowledge
a) None b) Empty Tuple c) Empty List d) Error

5 What is returned when we execute the function fetchall() but no rows are available to
fetch ? Knowledge,
a) None b) Empty Tuple c) Empty List d) Error Understand

6 What is returned when we execute the function fetchmany() but no rows are available
to fetch ? Knowledge
a) None b) Empty Tuple c) Empty List d) Error

7 Which of the following are valid properties of mysql connector cursor?


a)lastrowid b)rowcount c)column_names d)All of the above Knowledge

8 Which function is called to make mysql connection with python? Knowledge


a) execute b) commit c) connect d) fetchone

9 What are invalid host values in connect function of MySql connector?


a) host="216.10.240.89" b) host="localhost" Knowledge
c) host="127.0.0.1" d) None of the above

10 Maximum how many parameters can be accepted by connect() method.


a) 2 b) 3 c) 4 d) 5 Knowledge

11 This is the Property of cursor object that returns the number of rows fetched
a) fetchall() b) resultset c) rowcount d) none of the above
Analysis

12 Whenever you run Insert, Update and Delete query using Python code, you must run
method within the connection object. Knowledge
a) fetchall() b) commit() c) executeQ d) None of the above

13 Fill in the blank


data = [
('Jane', 'F'), Knowledge
('Joe', 'M'),
('John', 'M'),
]
stmt = "INSERT INTO employees (first_name, hire_date) VALUES (%s, %s)"
cursor.___________(stmt, data)
a)execute b)executemany c) executeall d)executeQ

14 If mycursor is a valid cursor what will be the output of the following


mycursor.execute("select * from student") #student table has 5 rows Analysis
print(mycursor.rowcount)
a) 5 b)0 c) -1 d)None

15 If mycursor is a valid cursor what will be the output of the following


mycursor.execute("select * from student") #student table has 5 rows
myresult = mycursor.fetchmany(3) Evaluation
print(mycursor.rowcount)
a) 5 b)3 c) -1 d)None

KEY/ANSWER SHEET

Multiple Choice Questions

Q. No. 1 a) Tuple

Q. No. 2 b) List

Q. No. 3 b) List

Q. No. 4 a) None

Q. No. 5 c) Empty List

Q. No. 6 c) Empty List

Q. No. 7 d)All of the above

Q. No. 8 c) connect

Q. No. 9 d) None of the above

Q. No. 10 c) 4

Q. No. 11 c) rowcount

Q. No. 12 b) commit()

Q. No. 13 b)executemany

Q. No. 14 c) -1

Q. No. 15 b)3

Name of the vetter-INDER PAL SINGH


Name of the KV- KV RBNM SALBONI

Region-KOLKATA

Mobile No-86011655337

E-mail ID [email protected]
Name of the Chapter-DATABASE MANAGEMENT

Sl.No. Question Learning Objective


1 Assertion:A Primary Key is used to uniquely identify a record in a Application
relation
Reason: A Primary Key can not have duplicate value
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2 Assertion: All the candidate keys are Primary Key. Creation
Reason: Primary Key is used to uniquely identify a record in a
relation
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3 Assertion: Foreign Key is not used to uniquely identify a record in a Knowledge
relation
Reason: Foreign key can take NULL values
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
4 Assertion: NULL is Special value that is stored when actual data Understanding
value is unknown for an attribute.
Reason: Foreign key can take NULL values
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5 Assertion: Each attribute in a relation has a unique name. Understanding
Reason: Sequence of attributes in a relation is immaterial.
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
ANSWER

Assertion Reason Questions


Q.No.1 A

Q.No.2 D
Q.No.3 A
Q.No.4 B
Q.No.5 B
ASSERTION BASED QUESTIONS

Sl. Question Learning


No. Objective
1 Assertion: A unique key cannot serve the purpose of a Primary Key Understanding
Reason: A unique key attribute can hold null value.
(A) Both Assertion and reason are true and reason is the correct explanation of
assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2 Assertion: Update is a DDL command Understanding
Reason: DDL commands are used for defining the schema of the database.
(A) Both Assertion and reason are true and reason is correct explanation of
assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3 Assertion: Delete is DML command Understanding
Reason: Delete command deletes the table from a database
(A) Both Assertion and reason are true and reason is correct explanation of
assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

4 Assertion: Float datatype cannot be used for storing names Knowledge


Reason: Char(n) datatype can be used for storing names
(A) Both Assertion and reason are true and reason is correct explanation of
assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5 Assertion: Drop is not a DML command Knowledge
Reason: Drop is a TCL command
(A) Both Assertion and reason are true and reason is correct explanation of
assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Assertion Reason Questions


Q.No.1 A
Q.No.2 D
Q.No.3 C
Q.No.4 B
Q.No.5 C

ii.ASSERTION REASON TYPE QUESTIONS


Sl.No. Question Learning
Objective
1. Assertion: RDBMS stands for Relational Database Management Analysis
System. It is a program that offers commands to create, update, and
manage the data with multiple tables
Reason: . Examples of RDBMS are
1. MySQL
2. Oracle
3. Microsoft SQL Server.

(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2. Assertion : Constraints are the condition define against the column of Analysis
a table.
Reason : Constraints are the checking condition which we apply on
table to ensure the correctness of data .

(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3. Assertion : Data definition language. Consists of commands used to Analysis
modify the metadata of a table. For Example- create table, alter table,
drop table.

Reason : Data manipulation language. Consist of commands used to


modify the data of a table. For Example- insert, delete, update

(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
4. Assertion : Primary Key is one or more attribute of a relation used to Analysis
uniquely identify each and every tuple in the relation.

Reason : For Example : In the below Table Student, RollNo can be the
Primary Key
RollNo Name Marks
1 Pratham 75
2 Srishti 80

(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5. Assertion : Suppose there are suppliers from 30 different cities. A Analysis
person wants to list only those records of supplier table who belongs
to 'Delhi', 'Mumbai','Kolkata', 'Chennai', 'Chandigarh' and
‘Ahmedabad'.
Reason : IN operator used in SQL queries to specify the list of values
for searching.

(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Assertion Reason Questions


Q.No.1 B
Q.No.2 A
Q.No.3 B
Q.No.4 B
Q.No.5 A
QUESTIONS :

Sl.No. Question Learning Objective


1. Assertion: DELETE FROM relation_name Knowledge
WHERE condition;
Reason: DELETE is a Data Manipulation Language (DML)
command and used when we want to remove some or all the
tuples from a relation.

(A) Both Assertion and reason are true and reason is the correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2. Assertion: DELETE is a Data Manipulation Language (DML) Knowledge
command and used when we want to remove some or all the
tuples from a relation.

Reason: DROP is a Data Definition Language (DDL) command


which removes the named elements of the schema like relations,
domains or constraints and you can also remove an entire schema
using DROP command.

A) Both Assertion and reason are true and reason is the correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.


3. Assertion: ALTER TABLE table_name Analysis
ADD column_name datatype;

Reason: Alter table help us to modify the data values of a given


table.

A) Both Assertion and reason are true and reason is the correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.


4. Assertion: create cs database; Analysis

Reason: create database databasename help us to create database.

A) Both Assertion and reason are true and reason is the correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.


5. Assertion: Show databases; Application

Reason: It helps us to display all tables of databases.

A) Both Assertion and reason are true and reason is correct


explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.

(D) Assertion is false, reason is true.

Assertion Reason Questions


Q.No. Answer
1 (A) Both Assertion and reason are true and reason is the correct
explanation of assertion.

2 (B) Assertion and reason both are true but reason is not the correct
explanation of assertion
3 (C) Assertion is true, reason is false.
4 (D) Assertion is false, reason is true.
5 (C) Assertion is true, reason is false.

Sl. Question Learning


No. Objective
1. Assertion (A) : Between operator produces a resultset based on expression within a Applying
range.
Reason (R): An expression can be written using >= and <= operators equivalent to
Between Operator.
(A) Both Assertion and reason are true and reason is correct explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2. Assertion (A): Delete, Drop and Truncate are examples of DDL Commands. Applying
Reason (R): DELETE operations can be rolled back (undone), while DROP and
TRUNCATE operations cannot be rolled back.
(A) Both Assertion and reason are true and reason is correct explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3. Assertion (A): When an expression includes Multiple SQL operators, the sequence in Applying
which they are evaluated is known as the SQL operator's precedence.
Reason (R): The Operators having low precedence are evaluated First and Operators
having higher precedence are evaluated last in SQL.
(A) Both Assertion and reason are true and reason is correct explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
4. Assertion (A): Distinct Clause is used to eliminate duplicate values from a resultset Analysing
based on a SQL Query. ,
Reason (R): The SQL ORDER BY clause can be used with the DISTINCT clause for Evaluatin
sorting the results after removing duplicate values. g and
(A) Both Assertion and reason are true and reason is correct explanation of assertion. Creating
(B) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5. Assertion (A): The LIKE is a Logical operator in SQL is used to search for character Analysing
string with the specified pattern using wildcards in a column. ,
Reason (R): There are three wildcards (%), (_) and (#) used in SQL Evaluatin
(A) Both Assertion and reason are true and reason is correct explanation of assertion. g and
(B) Assertion and reason both are true but reason is not the correct explanation of Creating
assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
ANSWERS
Assertion Reason Questions
Q.No. Answer
1. A

2. A

3. C

4. A

5. B

ARQ Based Questions


QUESTION ANSWER
1 Assertion: Cardinality of the resultant table of Cartesian Product of two tables will be the product (a)
of the cardinalities of these two tables.
Reason: Cartesian product generates all possible combination of two tables
(a) Both A and R are True
(b) A is True but R is False
(c) A is False but R is True
(d) Both A and R are False.
2 Assertion: Count(*) and Count(Column Name) returns same outputs. (c)
Reason: Null values are not counted by Count()
(a) Both A and R are True
(b) A is True but R is False
(c) A is False but R is True
(d) Both A and R are False.
3 Table: Hospital (d)
ID Name Dept charges
E1 Kabir Ent 350
C1 Zahir Cardiology 150
S1 Raju Surgery NULL
Assertion: Select Avg(charges) from Hospital; Output: 166.666667
Reason: Avg( ) includes NULL values.
(a) Both A and R are True
(b) A is True but R is False
(c) A is False but R is True
(d) Both A and R are False.
4 Assertion: Select Dept, count(*) from hospital group by Dept where count(*)>1; Output: Error (b)
Reason: Exactly one patient admitted in each Dept.
(a) Both A and R are True
(b) A is True but R is False
(c) A is False but R is True
(d) Both A and R are False.
5 Assertion: Select Max(Name) from hospital; Output: Error (d)
Reason: Max( ) can only be used with numeric columns.
(a) Both A and R are True
(b) A is True but R is False
(c) A is False but R is True
(d) Both A and R are False.
ii.ASSERTION REASON TYPE QUESTIONS
Sl.n Question Learning
o. Objective
1 Assertion SQL does not permit distinct with count(*) Applying
Reason: SQL does not permit distinct with count(*) but the use of distinct is
allowed with max and min
(a) Both Assertion and reason are true and reason is correct explanation of
assertion.
(b) Assertion and reason both are true but reason is not the correct explanation of
assertion.
(c) Assertion is true, reason is false.
(d) Assertion is false, reason is true.

2 Assertion: GROUP BY clause and ORDER BY clause are different. Applying


Reason: GROUP BY clause used for grouping of data and ORDER BY clause
used for sorting of data.
a) Both Assertion and reason are true and reason is the correct explanation of
assertion.
b) Assertion and reason both are true but reason is not the correct explanation of
assertion.
c) Assertion is true, reason is false.
d) Assertion is false, reason is true.

3 Assertion: Single row functions work with a single row. Applying


Reason: A single row function returns aggregated value.
a) Both Assertion and reason are true and reason is the correct explanation of
assertion.
b) Assertion and reason both are true but reason is not the correct explanation of
assertion.
c) Assertion is true, reason is false.
d) Assertion is false, reason is true.
4 Assertion: HAVING clause is different from where clause Applying
Reason: HAVING clause places condition on groups in contrast to WHERE clause
that places condition on individual rows.
a) Both Assertion and reason are true and reason is the correct explanation of
assertion.
b) Assertion and reason both are true but reason is not the correct explanation of
assertion.
c) Assertion is true, reason is false.
d) Assertion is false, reason is true.

5 Assertion: COUNT(expression) and COUNT(*) are not the same. Applying


Reason: COUNT(*) will count the number of rows, COUNT(expression) will
count non-null values in expression.
a) Both Assertion and reason are true and reason is the correct explanation of
assertion.
b) Assertion and reason both are true but reason is not the correct explanation of
assertion.
c) Assertion is true, reason is false.
d) Assertion is false, reason is true.

Assertion Reason Questions


1 a
2 a
3 c
4 b
5 b
INTERFACE OF PYTHON WITH MYSQL
ii. ASSERTION REASON TYPE QUESTIONS
Sl.No. Question Learning Objective
1 Assertion: Mr Ravi had taken a variable as a connection object and Analysis
used connect() function with MySQL database specification like host
name, username, password or passwd and database itself. But
connection could not establish.
Reason: To use connect( ) function user must include or import
mysql.connector in the beginning of the program.
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
2 Assertion:Following code was used to view all the tables in the Analysis /
database “school” but the expected result was not shown. Application
Import mysql.connector
Mydb = mysql.connector.connect(host= “localhost”,user=
“root”,password=“india”, database = “school”)
Mycursor = mydb.cursor()
Mycursor.show(“SHOW TABLES”)

Reason: loop is not used to print the records


(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
3 Assertion: An user run the following command to input a new record Analysis /
in the table Application
cur.execute("insert into students values(1111,'Asmita',78.50,'B1')
but he found that record cannot be inserted in the table .
Reason: Commit() function must used to save the changes and reflect
the data in the table
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
4 Assertion: To retrieve Three(03) students details we use Analysis /
cursor.fetchmany(03) function. Application
Reason: The number of rows is a compulsory parameter for
cursor.fetchmany( 3 )
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.
5 Assertion: To create a table in MySQL, use the "CREATE TABLE" Analysis /
statement. Evaluation
Reason: we can use cursor.run() to create the table.
(A) Both Assertion and reason are true and reason is correct
explanation of assertion.
(B) Assertion and reason both are true but reason is not the correct
explanation of assertion.
(C) Assertion is true, reason is false.
(D) Assertion is false, reason is true.

Assertion Reason Questions


Q.No.1 (A) Both Assertion and reason are true and reason is correct explanation of
assertion.
Q.No.2 (B) Assertion and reason both are true but reason is not the correct explanation
of assertion. In place of show() execute() method should have been used.
Q.No.3 (A) Both Assertion and reason are true and reason is correct explanation of
assertion
Q.No.4 (C) Assertion is true, reason is false.
Q.No.5 (C) Assertion is true, reason is false

Sl. No. Question Learning


Objective

Assertion (A):

mydb = mysql.connector.connect( host="localhost", user="yourusername",


password="yourpassword")
mycursor = mydb.cursor()
mycursor.execute("CREATE DATABASE mydatabase")

#Above code creates a new database in mysql server

Application
Reason (R): We can create a new database using execute function

(A) Both A and R are true and R is the correct explanation of assertion.
(B) A and R both are true but R is not the correct explanation of A .
(C) A is true, R is false.
1 (D) A is false, R is true.

Assertion (A):

mycursor.execute("DELETE FROM customers WHERE address = ‘M’")

2 #Above code deletes the desired rows from the table


Evaluation
Reason (R): Commit function should be called to save the changes

(A) Both A and R are true and R is the correct explanation of assertion.
(B) A and R both are true but R is not the correct explanation of A .
(C) A is true, R is false.
(D) A is false, R is true.

Assertion (A):

data = [
('Jane', 'F'),
('Joe', 'M'),
('John', 'M'),
]
stmt = "INSERT INTO employees (first_name, hire_date) VALUES (%s, %s)"
cursor.execute(stmt, data)
3 mydb.commit() Application

#Above code will insert the three rows in database

Reason (R): execute function can’t be used to insert multiple rows

(A) Both A and R are true and R is the correct explanation of assertion.
(B) A and R both are true but R is not the correct explanation of A .
(C) A is true, R is false.
(D) A is false, R is true.

Assertion (A):

mydb = mysql.connector.connect( host="178.23.45.252", user="yourusername",


password="yourpassword") Knowledge

#Above connection will be successful

4 Reason (R): host variable should be initialized with value ‘localhost’

(A) Both A and R are true and R is the correct explanation of assertion.
(B) A and R both are true but R is not the correct explanation of A .
(C) A is true, R is false.
(D) A is false, R is true.

Assertion (A):

mydb = mysql.connector.connect( host="178.23.45.262", user="yourusername",


password="yourpassword")

#Above connection will not be successful

Reason (R): database name has not been provided in the connect function call
5 Understand
(A) Both A and R are true and R is the correct explanation of assertion.
(B) A and R both are true but R is not the correct explanation of A .
(C) A is true, R is false.
(D) A is false, R is true.
ASSERTION REASON TYPE QUESTIONS

1 (A) Both A and R are true and R is the correct explanation of assertion

2 (D) A is false, R is true.

3 (D) A is false, R is true.

4 (C) A is true, R is false

5 (B) A and R both are true but R is not the correct explanation of A .

Name of the vetter-INDER PAL SINGH

Name of the KV-KV RBNM SALBONI

Region-KOLKATA

Mobile No-8601155337

E-mail ID [email protected]
Name of the Chapter-DATABASE MANAGEMENT

Sl.No. Read the passage given below and answer the following questions…….. Learning Objective
1 Harekrishna Company wants to create a database to maintain following
details
Employee (Emp_id, Empname, Address, Department, Aadhar_Number)
Dependent(Emp_id, Dependent_Name, Age)
1. The attribute of Employee, which can be worked as candidate key Evaluation
(A) Emp_id
(B) Aadhar_Number
(C)Both of above
(D) None of these

2. Degree of Employee table is _________ Evaluation


(A) 5
(B) 4
(C) 3
(D) 2

3. Degree of Dependent table is _________ Evaluation


(A) 5
(B) 4
(C) 3
(D) 2

4. Which attribute is suitable to serve as foreign key in Dependent table Evaluation


(A) Emp_id
(B) Dependent_Name
(C) Age
(D) None of these

2 Navjyoti School wants to create a database to maintain following details


Student (Unique_id, Stuname, Address, Class)
Guardian(Unique_id, Guardian_Name, Relation)
1. The attribute of Student relation, which can be worked as primary key Evaluation
(A) Unique_id
(B) Stuname
(C)Both of above
(D) None of these

2. Degree of Student table is _________ Evaluation


(A) 5
(B) 4
(C) 3
(D) 2

3. Degree of Guardian table is _________ Evaluation


(A) 5
(B) 4
(C) 3
(D) 2
4. Which attribute is suitable to serve as foreign key in Guardian table Evaluation
(A)Unique_id
(B) Guardian_name
(C) Relation
(D) None of these

ANSWER

Case Study Questions


Q.No.1 1.(C)
2.(A)
3.(C)
4.(A)
Q.No.2 1.(A)
2.(B)
3.(C)
4.(A)

Sl. Consider the table(s) given below and answer the following questions from (i) to Learning
No. (iv) Objective
1. Amrita wants to store following data in a table: Student but she is not well Analysis
versed with SQL. Help her in taking decisions to define the schema of the table.

TABLE: STUDENT
STUD NAME FNAME MNAME CLASS SECTION
_ID
2001 AMRITA HANS LAL MINU DEVI 6 B
2002 AMRIT HARISH KRISHNA 7 A
2003 NITIN PHUKAN HRITIKA 8 A
SINGH
2004 LOKESH GULAB ANJANA 9 C
KUMAR

(i) What will be the datatype for FNAME?


a. CHAR
b. VARCHAR(N)
c. INT
d. DATE
(ii) What will be the datatype for SECTION?
a. CHAR
b. VARCHAR(N)
c. INT
d. DATE
(iii) What should be the datatype of CLASS?
a. CHAR
b. VARCHAR(N)
c. INT
d. DATE
(iv) Which field can be considered the PRIMARY KEY?
a. NAME
b. FNAME
c. CLASS
d. STUD_ID

2 Consider the below given tables and answer the questions (i) to (iv): Analysis
TABLE: STUDENT
STUD NAME GNAME G_ID CLASS SECTION
_ID
2001 AMRITA HANS LAL 1001 6 B
2002 AMRIT HARISH 1002 7 A
2003 NITIN PHUKAN SINGH 1003 8 A
2004 LOKESH GULAB KUMAR 1004 9 C

TABLE: GUARDIAN
G_ID GNAME PHONENUMBER ADDRESS
1001 HANS LAL 9899712716 Lekhi
1002 HARISH 9034847512 Doimukh
1003 PHUKAN SINGH 8059190191 Nirjuli
1004 GULAB KUMAR 9992230098 Karsingsa

(i) Consider Table: GUARDIAN which attribute can be considered as


PRIMARY KEY?
a. G_ID
b. GNAME
c. PHONENUMBER
d. ADDRESS
(ii) In Table: STUDENT, the G_ID should not be repeated which constraint can
be used to serve the purpose?
a. NOT NULL
b. PRIMARY KEY
c. UNIQUE KEY
d. CHECK
(iii) What is the degree of table STUDENT?
a. 5
b. 6
c. 4
d. 7
(iv) What is the cardinality of table GUARDIAN?
a. 5
b. 6
c. 4
d. 7
Case Study Questions
Q.No.1 (i) b
(ii) a
(iii) c
(iv) d
Q.No.2 (i) a
(ii) c
(iii) b
(iv) c

Sl.No. Read the passage given below and answer the following Learning Objective
questions……..
1 An organization SoftSolutions is considering to maintain their Understanding
employees
records using SQL to store the data. As a database administer, Murthy
has
decided that :
• Name of the database - DATASOFT
• Name of the table - HRDATA
• The attributes of HRDATA are as follows:
ECode – Numeric
EName – character of size 30
Desig – Character of size 15
Remn – numeric
Table: HRDATA

Select the correct option for the following queries:

(A) Select the correct attribute best suitable to be declared as a


primary key.
a) EName
b) ECode
c) Remn
d) Desig

(B) Select the degree and cardinality of the table HRDATA.


a) 4 and 5
b) 5 and 4
c) 4 and 9
d) None
(C) Select the command to delete the record of Jeevan from the table
HRDATA.
a) drop from HRDATA where ENAme = “Jeevan”;
b) delete * from HRDATA where ENAme = “Jeevan”;
c) delete from HRDATA where EName = “Jeevan”;
d) drop * from HRDATA where ENAme =”Jeevan”;

(D) Select the statement to increase the Remn of all the employees by
10
percent.
a) update HRDATA set Remn = Remn + (0.1*Remn) ;
b) modify HRDATA set Remn = Remn + (0.1*Remn) ;
c) change HRDATA set Remn = Remn + (0.1*Remn) ;
d) update HRDATA set Remn = Remn + (10 % of Remn) ;

2 City Hospital is considering to maintain their inventory using SQL to Understanding


store the data. As a database administer, Nitin has decided that :
• Name of the database - CH
• Name of the table - CHStore
• The attributes of CHStore are as follows:
ItemNo - numeric
ItemName – character of size 20
Scode - numeric
Quantity – numeric
Table : CHStore

Select the correct option for the following queries:

(A) Select the command to insert the following data into the
attributes ItemNo, ItemName, SCode and Quantity respectively
in the given table CHStore.
ItemNo = 21010, ItemName = “Trocars” , Scode = 14 and
Quantity=28

a. add into CHStore values( 21010, “Trocars” , 14 , 28);


b. insert into CHStore values( 21010, “Trocars” , 14 , 28);
c. insert into table CHStore values( 21010, “Trocars” , 14 , 28);
d. update into CHStore values( 21010, “Trocars” , 14 , 28);

(B) Ritika wants to add a column to the table CHStore. Which


command will she use from the following:

a) Insert
b) Alter
c) Create
d) Add

(C)Now Ritika wants to display the structure of the table CHStore, i.e,
name of the attributes and their respective data types that she has
used in the table. Help her to choose the correct query :

a) Show table CHStore;


b) Display CHStore;
c) Desc CHStore;
d) Select * from CHStore;

(D) Ritika wants to remove the column Quantity from the table
CHStore . Help her to select the correct command:

a) Alter table CHStore drop column Quantity;


b) Drop column Quantity from table CHStore;
c) Remove column Quantity from table CHStore;
d) Delete Quantity from table CHStore;

ANSWERS
Case Study Questions
Q.No. (A) ECode
1 (B) 4 and 5
(C) delete from HRDATA where EName = “Jeevan”;
(D) update HRDATA set Remn = Remn + (0.1*Remn) ;
Q..No. (A) insert into table CHStore values( 21010, “Trocars” , 14 , 28);
2 (B) Alter
(C) Desc CHStore;
(D) Alter table CHStore drop column Quantity;

QUESTIONS

Sl.No. Read the passage given below and answer the following questions…….. Learning Objective
Agnisudha want to write SQL statement to create a table named job_histry ……..
including columns employee_id, start _date, end _date, job_id and department_id
and make sure that the value against column end_date will be entered at the time
of insertion to the format like '--/--/----'. She inserted 10 employees details in her
tables.
1. Help Agnisudha to choose the correct data type for entering the values of Analysis
start date, end date.

a) Varchar
b) Char
c) Int
d) date

2. Agnisudha want to delete all values of the tables. Help her to choose the correct Analysis
command for her requirement.

a) Delete * from job_histry;


b) Delete from job_histry;
c) Drop from job_histry;
d) Drop job_histry;
3. Agnisudha want to see the value of the entire table. Which command is suitable? Application
a) Select * from job_histry;
b) Select from job_histry;
c) Show job_histry
d) Use job_histry

4. She wants to start work with her database. Which command helps her to choose Application
the correct work.
a) Use database_name;
b) Use tables;
c) Required database; show tables;
d) Required database; shows tables;

5. She wants to delete every data with database details .Which command will help Analysis
her.
a) Delete database;
b) Delete from tablename;
c) Drop database databasename;
d) Drop databasename;

Soma has created cs database with five tables for her five subjects. But she has
forgotten to recall her table name.
1. Help soma to write commands to see all tables name. Analysis
a) Show databases;
b) Show database;
c) Show tables; use cs;
d) use cs; Show tables
2. She wants to see the structures of the ip table. creativity
Help her to choose a command.
a) Desc ip;
b) Show ip;
c) Select from table ip;
d) Select * from ip;

3. She wants to add a new column in ip tables. Which clause helps her to do work. Analysis
a) Alter
b) Update
c) Delete
d) select

4. Soma wants to see the details of ip tables. Help her to choose the correct query. Analysis
a) Select * from ip;
b) Desc ip;
c) Show ip;
d) Select from table ip;

5. She wants to insert one row in her table ip. Which DML command helps her. Analysis
a) Select
b) Insert
c) Update
d) Delete.

Case Study Questions


Q.No. Answer
1 (d) date

2 (b) Delete from job_histry;

3 a) Select * from job_histry;

4 Use database_name;

5 (c) Drop database databasename;

Sl.No. Read the passage given below and answer the following questions…….. Learning
Objective
1. Consider a table EMPLOYEE with the following data: Analysin
ENO ENAME SALARY BONUS DATEOFJOIN JOBTYPE g,
A01 Piya Thakur 30000 45.23 29-10-2019 Clerk Evaluatin

A02 Rahul Gupta 50000 25.34 13-03-2018 Analyst g and

B03 Nishu Gujral 30000 35.00 18-03-2017 Salesman Creating

B04 Tanu Roy 80000 23.45 31-12-2018 Manager


C05 Gautam Kumar 20000 32.05 23-01-1989 Clerk
C06 Julie Singh 70000 12.37 15-06-1987 Analyst
D07 Neha Sharma 50000 27.89 18-03-1999 Manager
a. Write down a query to display Employee’s name and bonus after rounding off to
zero decimal places.
b. Write down a query to display the names of all the Employees with their date of
joining in ascending order.
c. Write down a query to display the names of the Employees whose names contains
‘a’ in their names.
d. Write down a query to display the names of those employees whose salary is
greater than 25000.
e. Write down a query to display the information of those employees whose joining
is in between 01/01/1985 and 31/03/2000.
2. Consider a table TEACHER with the following data: Analysin
TCODE TNAME SUBJECT SEX SALARY g,
Evaluatin
5467 Narendra Kumar Computer Science M 70000
g and
6754 Jay Prakash Accountancy M Null Creating
8976 Ajay Kumar Chemistry M 65000

5674 Jhuma Nath English F 55000

8756 Divya Bothra Computer Science F 75000

6574 Priyam Kundu Physics M Null

3425 Dinesh Verma Economics M 71000

a. Write a query to list the names of female teacher who teaches CS.
b. Write a query to update the salary of Chemistry teacher by 5%.
c. Write a query to display the different subjects offered in the school.
d. Write a query to delete the information of Economics teacher.
e. Write a query to list details of all teachers whose salary contain NULL.
ANSWERS
Case Study Questions
Q.No. Answer
1. a. SELECT ENAME,ROUND(BONUS,0) FROM EMPLOYEEE;

b. SELECT ENAME, DATEOFJOIN FROM EMPLOYEE ORDER BY DATEOFJOIN;


c. SELECT ENAME FROM EMPLOYEE WHERE ENAME LIKE ‘%A%’;
d. SELECT ENAME FROM EMPLOYEE WHERE SALARY>25000;
e. SELECT * FROM EMPLOYEE WHERE DATEOFJOIN BETWEEN ‘1985-01-01’ AND
‘2000-03-31’;
2. a. SELECT TNAME FROM TEACHER WHERE SUBJECT=’CS’ AND SEX=’F’;
b. UPDATE TEACHER SET SALARY=((0.05*SALARY)+SALARY) WHERE
SUBJECT=’CHEMISTRY’;
c. SELECT DISTINCT(SUBJECT) FROM TEACHER;
d. DELETE FROM TEACHER WHERE SUBJECT=’ECONOMICS’;
e. SELECT * FROM TEACHER WHERE SALARY IS NULL;

Sl.N See the following table given below and answer the following questions Learning
o. Objective
1 Table-EXAM Analysing,

No. Name Stipend Subject Average Division Evaluating and


1 Karan 400 English 68 First Creating
2 Aman 680 Mathematics 72 First
3 Javed 500 Accounts 67 First
4 Bishakh 200 Informatics 55 Second
5 Sugandha 400 History 35 Third
6 Suparna 550 Geography 45 Third

a) SELECT AVG(Stipend) FROM EXAM WHERE DIVISION=”THIRD”


b) SELECT COUNT(DISTINCT Subject) FROM EXAM;
c) SELECT MIN(Average) FROM EXAM WHERE Subject=”English”;

2 See the following tables given below and answer the following questions
Table: ACTIVITY Analysing,

ACod ActivityNa ParticipantsNum PrizeMoney ScheduleDate Evaluating and


Creating
e me
1001 Relay 16 10000 23-Jan-2004
100x4
1002 High jump 10 12000 12-Dec-2003
1003 Shot Put 12 8000 14-Feb-2004
1005 Long Jump 12 9000 01-Jan-2004
1008 Discuss 10 15000 19-Mar-2004
Throw

a) SELECT COUNT(DISTINCT ParticipantsNum) FROM ACTIVITY;


b) SELECT MAX(ScheduleDate),MIN(ScheduleDate) FROM
ACTIVITY;
c) SELECT SUM(PrizeMoney) FROM ACTIVITY;

ANSWER OF CASE/SOURCE BASED QUESTIONS:


1. (a) 475
(b) 6
(c) 68
2. (a) 3
(b) 19-Mar-2004, 12-Dec-2003
(c) 54000

INTERFACE OF PYTHON WITH MYSQL DATABASE

iii.CASE/SOURCE BASED QUESTIONS:


Sl.No. Read the passage given below and answer the following questions: Creation / Application
Mr Ravi is a Manager and he has a responsibility for maintaining
the records of his employees in MySQL database. He had developed a
python code to connect with database in MYSQL name ‘Company’
but facing some problem . Help him to rectify the code and obtain the
desired result
Import …………………………..#Line1
Mydb = mysql.connector.connect(host= “localhost”,user=
“root”,……………………) # line 2
Mycursor = mydb.cursor()
Mycursor.execute(“________________________________”) #Line-3
for x in Mycursor:
print(x)
______________________ #Line-4
1 What is the correct statement for line-1 to include MYSQL driver Creation / Application
(A) import mysql.connector
(B) import connector.mysql
(C) import mysql.connection
(D) None of the above
2 Which necessary parameter is missing at line2 to complete the Creation / Application
connection
(A) dbms =’Company’
(B) database=’Company’
(C) dbase=’Company’
(D) None of the above
3. What is the correct statement for line-3 to fetch the details of all Creation / Application
employees whose salary greater than 5000
(A) Select * from employee where salary >5000
(B) Select name from employee where salary >5000
(C) Select * from employee where salary= >5000
(D) Select name from employee where salary <5000
4. What should be the correct code in Line-4 to close the connection
(A) exit()
(B) mydb.exit()
(C) Mydb.close()
(D) close.Mydb()

Case Study Questions


Q.No. 1 (A)
Q.No. 2 (B)
Q.No. 3 (A)
Q.No. 3 (C)
iii.CASE/SOURCE BASED QUESTIONS:

Sl. No. Question Learning


Objective

import ____________________ # line 1


mydb = mysql.connector.connect( host="localhost", user="yourusername",
password="yourpassword", database="mydatabase" ) Understand,
mycursor = mydb.cursor() Apply,
sql = "INSERT INTO customers (name, address) VALUES (%s, %s)" Evaluate,
val = ("John", "Highway 21") Create
mycursor.execute(sql, val)
_________________ # line 2
1
(A) Which module should be imported at line 1?
(i) mysql-connector
(ii) mysql.connector
(iii) mysqlconnector
(iv) connector
(B) What function should be called in line 2 to save the changes
(i) mydb.commit()
(ii) mycursor.commit()
(iii) commit()
(iv) mysql.commit()
mycursor.execute("SELECT * FROM customers")
myresult = _________________________________# line 1
for x in myresult:
print(x)
Understand,
(A) Which function is called in line 1 to print complete table Apply,
2 (i) mycursor.fetchall() Evaluate,
(ii) mycursor.fetchone() Create
(iii) print
(iv) commit
(B) What is the datatype of x
(i) tuple
(ii) list
(iii) dictionary
(iv) str

CASE/SOURCE BASED QUESTIONS

1 (A) (ii) mysql.connector (B) (i) mydb.commit()

2 (A) (i) mycursor.fetchall() (B) (i) tuple

Name of the vetter-INDER PAL SINGH

Name of the KV- KV RBNM SALBONI

Region-KOLKATA

Mobile No-8601155337

E-mail ID [email protected]
Name of the Chapter-DATABASE MANAGEMENT

Sl.No. Question Learning Objective


1 Data Redundancy means same data are duplicated in Understanding
different places
2 Data inconsistency occurs when same data maintained Understanding
in different places do not match
3 A special value “NULL” is used to represent values that are Understanding
unknown to certain attributes
4 All candidates keys are primary key Evaluation
5 A relation may consist of more than one primary key. Evaluation
ANSWER

Q.No.1 True
Q.No.2 True
Q.No.3 True
Q.No.4 False
Q.No.5 False

Sl.No. Question Learning Objective


1 CREATE is a DDL command. Knowledge
a. True
b. False
2 DD/MM/YYYY is the format for inserting date using DATE datatype. Understanding
a. True
b. False
3 Attributes having NOT NULL constraint cannot be left blank while Understanding
inserting data.
a. True
b. False

4 Unique key can serve as Primary Key only if the Unique key attribute Understanding
also has NOT NULL constraint.
a. True
b. False
5 DROP is a DML command. Knowledge
a. True
b. False
True False Questions
Q.No.1 True
Q.No.2 False
Q.No.3 True
Q.No.4 True
Q.No.5 False

Sl.No. Question Learning Objective


1. Unique is used to eliminate the duplicate rows from the output in SQL Analysis
query [True or False ]

2. Delete command deletes the table structure and Drop command deletes Analysis
the data from a SQL Table . [True or False ]
3. Null (unavailable and unknown) values are entered by the following Analysis
command:
INSERT INTO TABLE_NAME VALUES (“NULL”);

[True / False]
4. Foreign key column derives its value from the primary key of the parent Analysis
table.
[Trure/ False]
5. ALTER TABLE command is used to modify the structure of the table. Analysis

[True / False]

True False Questions


Q.No. 1 False
Q.No. 2 False
Q.No. 3 False
Q.No. 4 True
Q.No. 5 True
Sl. Question Learning
No. Objective
1 SQL is a programming language. Knowledge
a) True
b) False
2 Data Manipulation Language (DML) commands are used to define a database,
including creating, altering, and dropping tables and establishing constraints.
a) True
b) False
3 Unique and Primary key constraints are the same.
a) True
b) False
4 NOT NULL is a constraint that can be defined only at the column level
a) True
b) False
5 DDL is similar to a computer programming language for defining data structures,
especially database schemas.
a) True
b) False

True False Questions


Q.No. 1 Answer: b) False
Q.No. 2 Answer: b) False
Q.No. 3 Answer: b) False
Q.No. 4 Answer: a) True
Q.No. 5 Answer: a) True
IV.TRUE- FALSE QUESTIONS:
Sl.No. Question Learning Objective
1. Analysis
The condition in a WHERE clause in a SELECT query can refer to only
one value.

2 The rows of the result relation produced by a SELECT statement can be understanding
sorted but only by one column.

3 knowledge
The WHERE clause is used to specify filtering conditions for groups.
4. The SQL statement: SELECT salary + Comm AS Total FROM Emp; creativity
adds two fields salary and comm from each row together and lists the
results in a column named Total.
5. Drop command delete structure of table. knowledge

True False Questions


Q.No. Answer
1 false
2 false
3 false
4 True
5 True

QUESTIONS
Sl.No. Question Learning
Objective
1. The BETWEEN operator includes both begin and end values. Applying
2. Logical operators and Relational opertors can not ne used together. Applying
3. Update and delete statements are DDL statements. Rememberin
g&
Understading
4. When multiple opertors are used in a SQL Query, low precedence operators are Applying
evaluated in last.
5. A user may specify two or more columns as using the SELECT – DISTINCT Applying
clause

ANSWERS
True False Questions
Q.No. Answer
1 True
2 False
3 False
4 True
5 True

True/False BASES QUESTIONS AND ANSWERS


1 MIN and MAX can only be used with numeric columns. False
2 The HAVING clause acts like a WHERE clause, but it identifies groups that meet a criterion, rather than True
rows.
3 The SQL keyword GROUP BY instructs the DBMS to group together those rows that have the same value True
in a column.
4 SUM () function is used to count the total number of records in a table. False
5 COUNT () function ignores null values while counting the records. True

TRUE/FALSE BASED QUESTION


Q.N QUESTION ANS
1 COUNT(*) function ignore duplicates and null values while counting the records False
2 MAX() function returns an integer field. True
3 You can combine all the records that have identical values in a particular field on a group of False
fields by using ORDER BY statement
4 To filter the conditions for groups, WHERE clause is used. False
5 Group functions can be applied on any data types i.e numeric, data, string True
TRUE- FALSE QUESTIONS:
Sl.N Question Learning
o. Objective
1 Any attribute which is present in the having clause without being aggregated must Remembering

not be present in the group by clause. and

a) True understanding

b) False

2 We can rename the resulting attribute after the aggregation function has been Remembering

applied and

a) True understanding

b) False
3 To avoid a Cartesian product, always include a valid join condition in a WHERE Remembering

clause. and

a) True understanding

b) False
4 Understanding the primary and foreign key relationship is not important to join on Remembering

the correct columns. and

a) True understanding

b) False
5 COUNT(Fieldname) tallies only those rows that contain a value; it ignores all null Remembering

values. and

a) True understanding

b) False

True False Questions


1 b
2 a
3 a
4 b
5 a
INTERFACE OF PYTHON WITH MYSQL DATABASE
TRUE- FALSE QUESTIONS:
Sl.No Question Learning
. Objective
1 fetchone() return None when no more data is available (T/F) Knowledge
2 We always get same result from the methods fetch() and fetchall(). (T/F) Analysis
3 rowcount is not a read-only attribute. (T/F) Analysis
4 close() method is used to disconnect database connection. (T/F) Knowledge
5 Once a database connection is established, we are ready to create tables Application
using execute method of the created cursor (T/F)

True False Questions


Q.No.1 True
Q.No.2 True
Q.No.3 False
Q.No.4 True
Q.No.5 True

Sl. No. Question Learning


Objective

rowcount is a read-only attribute,


1 a) True b) False Knowledge

The next row of resultset is fetched via fetchone().


2 a) True b) False Knowledge

We cannot create a new database using python MySql interface


3 a) True Knowledge
b) False

When we execute a MySql insert query in python, The new row gets saved in the Knowledge,
4 database Apply
a) True
b) False

We can not delete a mysql row using python program Knowledge,


5 a) True Apply
b) False

TRUE-FALSE QUESTIONS

1 (A) True

2 (A) True

3 (B) False

4 (A) False

5 (A) False

Name of the vetter-INDER PAL SINGH

Name of the KV- KV RBNM SALBONI

Region-KOLKATA

Mobile No-8601155337

E-mail ID [email protected]

You might also like