0% found this document useful (0 votes)
61 views57 pages

Chapter 9 Structured Query Language (SQL) Questions and Answers

This document is a structured query language (SQL) study material that includes multiple choice questions, fill-in-the-blanks, and various question formats aimed at assessing knowledge of SQL. It covers topics such as SQL commands, data types, constraints, and functions. The material is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International License.

Uploaded by

jsamuels02001
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)
61 views57 pages

Chapter 9 Structured Query Language (SQL) Questions and Answers

This document is a structured query language (SQL) study material that includes multiple choice questions, fill-in-the-blanks, and various question formats aimed at assessing knowledge of SQL. It covers topics such as SQL commands, data types, constraints, and functions. The material is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International License.

Uploaded by

jsamuels02001
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/ 57

M

O
H
A
M
M
ED
M
AT
H
EE
N
L
R
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

Contents

LICENSE 3

CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) 4


MULTIPLE CHOICE QUESTIONS (MCQs) . . . . . . . . . . . . . . . . . . . . . . . . . . 4
FILL IN THE BLANKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2 MARKS QUESTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

R
3 MARKS QUESTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5 MARKS QUESTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

L
CHAPTER END EXERCISES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

N
EE
H
AT
M
ED
M
M
A
H
O
M

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
2
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

LICENSE

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 4.0 Interna-
tional License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ or
send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

“Karnataka Second PUC Computer Science Study Material / Student Notes” by L R Mohammed Matheen
is licensed under CC BY-NC-ND 4.0.

R
L
N
Figure 1: Licence

EE
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 4.0 Interna-
tional License.

H
Portions of this work may include material under separate copyright. These materials are not covered by
AT
this Creative Commons license and are used by permission or under applicable copyright exceptions.

This book is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 4.0 Interna-


M

tional License.
ED
M
M
A
H
O
M

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
3
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL)

MULTIPLE CHOICE QUESTIONS (MCQs)

1. What does SQL stand for?


a) Structured Question Language
b) Simple Query Language
c) Structured Query Language

R
d) System Query Language

L
Answer: c

2. Which of the following is not a type of RDBMS?

N
a) MySQL

EE
b) Oracle
c) MongoDB
d) PostgreSQL
Answer: c H
AT
3. SQL is case sensitive in which environment?
a) Windows
M

b) Linux
c) Mac
ED

d) Android
Answer: b
M

4. Which of the following is a correct SQL statement to create a database named Library?
a) MAKE DATABASE Library;
M

b) NEW DATABASE Library;


c) CREATE DATABASE Library;
A

d) DATABASE Library;
H

Answer: c
O

5. Which command is used to list all databases in MySQL?


a) LIST DATABASES;
M

b) SHOW ALL DATABASES;


c) DISPLAY DATABASES;
d) SHOW DATABASES;
Answer: d

6. What is the purpose of the ‘USE’ command in SQL?


a) Create a new table

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
4
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) Delete a database
c) Select a database for use
d) Exit SQL
Answer: c

7. Which of the following is a valid datatype for storing dates in MySQL?


a) DATE
b) DATETIME

R
c) TIME
d) All of the above

L
Answer: d

N
8. CHAR(n) datatype in MySQL stores data of:
a) Fixed length

EE
b) Variable length
c) Integer
d) Binary type
H
AT
Answer: a

9. Which constraint ensures uniqueness of values in a column?


M

a) PRIMARY KEY
b) FOREIGN KEY
c) UNIQUE
ED

d) DEFAULT
Answer: c
M

10. Which two constraints together can form a primary key?


a) UNIQUE and DEFAULT
M

b) NOT NULL and UNIQUE


A

c) FOREIGN KEY and UNIQUE


d) NOT NULL and DEFAULT
H

Answer: b
O

11. What does the ALTER TABLE command do in SQL?


M

a) Deletes a table
b) Changes the structure of a table
c) Adds data to a table
d) Queries data
Answer: b

12. Which keyword is used to remove a column from a table?


a) REMOVE

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
5
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) DELETE
c) DROP
d) ALTER
Answer: c

13. Which command is used to view the structure of a table?


a) SHOW tablename
b) DESCRIBE tablename

R
c) VIEW tablename
d) PRINT tablename

L
Answer: b

N
14. What type of key is formed by combining multiple attributes?
a) Foreign key

EE
b) Alternate key
c) Composite key
d) Candidate key
H
AT
Answer: c

15. What happens if you run an UPDATE statement without a WHERE clause?
M

a) Nothing happens
b) Syntax error
c) All records are updated
ED

d) Only the first record is updated


Answer: c
M

16. Which statement is used to insert data into a table?


a) ADD INTO
M

b) INSERT INTO
A

c) PUT INTO
d) ENTER INTO
H

Answer: b
O

17. In which format is the DATE stored in MySQL?


M

a) DD-MM-YYYY
b) MM-DD-YYYY
c) YYYY-MM-DD
d) Any format
Answer: c

18. Which operator is used to compare a value with a set of values?


a) IN

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
6
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) LIKE
c) BETWEEN
d) ALL
Answer: a

19. Which SQL function returns the remainder of a division operation?


a) DIV
b) REM

R
c) MOD
d) ROUND

L
Answer: c

N
20. Which function is used to calculate exponential power in SQL?
a) EXP()

EE
b) ROUND()
c) POW()
d) SQRT()
H
AT
Answer: c

21. Which clause is used to sort records in ascending or descending order?


M

a) GROUP BY
b) ORDER BY
c) SORT BY
ED

d) ARRANGE BY
Answer: b
M

22. Which keyword is used with ORDER BY to sort in descending order?


a) REVERSE
M

b) DOWN
A

c) DESC
d) LOWER
H

Answer: c
O

23. Which function returns the name of the day from a date?
M

a) DAYNAME()
b) DAY()
c) DATENAME()
d) DAYOFWEEK()
Answer: a

24. Which clause helps in fetching only unique values from a column?
a) ONLY

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
7
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) UNIQUE
c) DISTINCT
d) NON-REPEATED
Answer: c

25. What is the result of any arithmetic operation with NULL?


a) 0
b) NULL

R
c) Error
d) Infinity

L
Answer: b

N
26. Which function returns current date and time in SQL?
a) CURRENT()

EE
b) NOW()
c) TIME()
d) SYSDATE()
H
AT
Answer: b

27. Which of the following is used for pattern matching in SQL?


M

a) LIKE
b) IN
c) AND
ED

d) IS
Answer: a
M

28. Which symbol is used to match any number of characters in SQL pattern matching?
a) _
M

b) %
A

c) *
d) #
H

Answer: b
O

29. Which SQL function removes leading spaces from a string?


M

a) RTRIM()
b) LTRIM()
c) TRIM()
d) REMOVE()
Answer: b

30. Which function converts string to uppercase in SQL?


a) UPPER()

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
8
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) UCASE()
c) TOUPPER()
d) CAP()
Answer: b

31. Which clause is used to group rows that have the same values?
a) ORDER BY
b) GROUP BY

R
c) SET BY
d) UNION

L
Answer: b

N
32. Which function returns the number of characters in a string?
a) LEN()

EE
b) LENGTH()
c) SIZE()
d) COUNT()
H
AT
Answer: b

33. Which clause is used to filter rows before grouping?


M

a) WHERE
b) HAVING
c) FILTER
ED

d) SELECT
Answer: a
M

34. Which clause is used to filter groups after grouping?


a) WHERE
M

b) HAVING
A

c) GROUP BY
d) FILTER
H

Answer: b
O

35. Which aggregate function returns the highest value in a column?


M

a) MAX()
b) TOP()
c) LAST()
d) HIGH()
Answer: a

36. Which clause in SQL is used to group records that have the same values in specified columns?
a) ORDER BY

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
9
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) GROUP BY
c) WHERE
d) HAVING
Answer: b

37. Which operator is used to test for NULL values?


a) = NULL
b) == NULL

R
c) IS NULL
d) EQUAL NULL

L
Answer: c

N
38. What will be the result of 5 + NULL in SQL?
a) 5

EE
b) 0
c) NULL
d) Error
H
AT
Answer: c

39. Which function extracts a substring from a string?


M

a) MID()
b) SUBSTRING()
c) SLICE()
ED

d) CUT()
Answer: a
M

40. What is the output of ROUND(123.456, 1)?


a) 123.4
M

b) 123.5
A

c) 123.45
d) 123
H

Answer: b
O

41. Which keyword is used to permanently remove a table from a database?


M

a) ERASE
b) DELETE
c) REMOVE
d) DROP
Answer: d

42. What is the output of MOD(11, 3)?


a) 2

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
10
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) 3
c) 1
d) 0
Answer: a

43. What is the purpose of the DEFAULT constraint?


a) Allows duplicate values
b) Adds a default value when no input is given

R
c) Restricts NULL values
d) Sets a foreign key

L
Answer: b

N
44. Which operator is used to match a value within a range?
a) IN

EE
b) RANGE
c) BETWEEN
d) BOUND
H
AT
Answer: c

45. Which one is not a single row function?


M

a) ROUND()
b) MOD()
c) AVG()
ED

d) LCASE()
Answer: c
M

46. Which function is used to get the month from a date?


a) MONTHNAME()
M

b) MONTH()
A

c) GETMONTH()
d) MTH()
H

Answer: b
O

47. Which of the following is a valid constraint that can be applied to enforce referential integrity
M

between two tables?


a) DEFAULT
b) PRIMARY KEY
c) UNIQUE
d) FOREIGN KEY
Answer: d

48. Which of the following conditions must be satisfied for a FOREIGN KEY to be added to a

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
11
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

table?
a) The table must have a DATE column
b) The referenced attribute must be of FLOAT type
c) The referenced column must be a PRIMARY KEY
d) The referenced table must be empty
Answer: c

49. Which SQL operator is used to check whether a column value falls between two values (inclu-

R
sive)?
a) IN

L
b) LIKE
c) RANGE

N
d) BETWEEN

EE
Answer: d

50. Which keyword is used to delete a particular row in SQL?


a) REMOVE
H
AT
b) ERASE
c) DELETE
d) DROP
M

Answer: c

51. Assertion (A): SQL is used only for retrieving data from databases. Reason (R): SQL stands
ED

for Structured Query Language.


a) Both A and R are true, and R is the correct explanation of A
M

b) Both A and R are true, but R is not the correct explanation of A


c) A is false, but R is true
M

d) A is true, but R is false


Answer: c
A

52. Assertion (A): VARCHAR stores variable-length character strings. Reason (R): CHAR and
H

VARCHAR allocate the same amount of memory for any string.


O

a) Both A and R are true, and R is the correct explanation of A


b) Both A and R are true, but R is not the correct explanation of A
M

c) A is true, but R is false


d) A is false, but R is true
Answer: c

53. Assertion (A): PRIMARY KEY allows duplicate values in a column. Reason (R): PRIMARY
KEY is used to uniquely identify each record.
a) Both A and R are true, and R is the correct explanation of A

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
12
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b) Both A and R are true, but R is not the correct explanation of A


c) A is false, but R is true
d) A is true, but R is false
Answer: c

54. Assertion (A): ALTER TABLE statement can be used to add a new column. Reason (R): ALTER
TABLE can modify the structure of an existing table.
a) Both A and R are true, and R is the correct explanation of A

R
b) Both A and R are true, but R is not the correct explanation of A
c) A is false, but R is true

L
d) A is true, but R is false
Answer: a

N
55. Assertion (A): The keyword DESC is used to sort records in descending order. Reason (R): The

EE
ORDER BY clause displays records in random order by default.
a) Both A and R are true, and R is the correct explanation of A

H
b) Both A and R are true, but R is not the correct explanation of A
AT
c) A is true, but R is false
d) A is false, but R is true
Answer: c
M

56. Assertion (A): SQL is a case-insensitive language. Reason (R): In SQL, ‘salary’ and ‘SALARY’
are treated as the same column names.
ED

a) Both A and R are true, and R is the correct explanation of A


b) Both A and R are true, but R is not the correct explanation of A
M

c) A is false, but R is true


d) A is true, but R is false
M

Answer: a
A

57. Assertion (A): The CREATE TABLE command is used to define the structure of a new table.
Reason (R): CREATE TABLE can define attribute names, data types, and constraints.
H

a) Both A and R are true, and R is the correct explanation of A


O

b) Both A and R are true, but R is not the correct explanation of A


c) A is true, but R is false
M

d) A is false, but R is true


Answer: a

58. Assertion (A): DEFAULT constraint ensures that every column must have a unique value.
Reason (R): DEFAULT sets a predefined value for a column when no value is provided.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
13
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

c) A is false, but R is true


d) A is true, but R is false
Answer: c

59. Assertion (A): DELETE statement removes a table from the database. Reason (R): DROP
TABLE statement is used to remove a table permanently.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A

R
c) A is false, but R is true
d) A is true, but R is false

L
Answer: c

N
60. Assertion (A): The WHERE clause in SQL is used to filter groups formed by GROUP BY.
Reason (R): HAVING clause filters records before they are grouped.

EE
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
c) A is false, but R is true
H
AT
d) Both A and R are false
Answer: d
M

61. Assertion (A): INSERT INTO command adds new records into a table. Reason (R): Records
can be inserted without specifying column names if all values are provided in correct order.
a) Both A and R are true, and R is the correct explanation of A
ED

b) Both A and R are true, but R is not the correct explanation of A


c) A is true, but R is false
M

d) A is false, but R is true


Answer: a
M

62. Assertion (A): A FOREIGN KEY can reference a column that is not a primary key. Reason
A

(R): A foreign key ensures that each value exists in another table’s primary key column.
a) Both A and R are true, and R is the correct explanation of A
H

b) A is true, but R is false


O

c) A is false, but R is true


d) Both A and R are false
M

Answer: c

63. Assertion (A): ROUND() is used to round numbers to specified decimal places. Reason (R):
ROUND(283.2, 0) will return 283.2.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
c) A is true, but R is false

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
14
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

d) A is false, but R is true


Answer: c

64. Assertion (A): The % symbol in SQL is used to match zero or more characters. Reason (R):
The LIKE clause in SQL supports pattern matching using wildcards.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
c) A is true, but R is false

R
d) A is false, but R is true
Answer: a

L
65. Assertion (A): The BETWEEN operator is inclusive of boundary values. Reason (R): BE-

N
TWEEN is used to test if a value lies between a specified range.
a) Both A and R are true, and R is the correct explanation of A

EE
b) Both A and R are true, but R is not the correct explanation of A
c) A is true, but R is false
d) A is false, but R is true
H
AT
Answer: a

66. Assertion (A): You can use the alias keyword AS to rename a column in the output. Reason
M

(R): Column aliasing affects the actual table structure permanently.


a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
ED

c) A is true, but R is false


d) A is false, but R is true
M

Answer: c

67. Assertion (A): NOW() function returns the current system date and time. Reason (R): NOW()
M

is a date function used in MySQL.


A

a) Both A and R are true, and R is the correct explanation of A


b) Both A and R are true, but R is not the correct explanation of A
H

c) A is false, but R is true


O

d) A is true, but R is false


Answer: a
M

68. Assertion (A): MID() function is used to extract a part of a string. Reason (R): MID() is a
numeric function used to perform arithmetic operations.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
c) A is true, but R is false
d) A is false, but R is true

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
15
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

Answer: c

69. Assertion (A): The TRIM() function is used to remove trailing spaces only. Reason (R): TRIM()
removes both leading and trailing spaces from a string.
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A
c) A is true, but R is false
d) A is false, but R is true

R
Answer: d

70. Assertion (A): The IS NULL operator is used to check for zero values. Reason (R): IS NULL

L
checks whether a column has NULL as its value.

N
a) Both A and R are true, and R is the correct explanation of A
b) Both A and R are true, but R is not the correct explanation of A

EE
c) A is false, but R is true
d) A is true, but R is false
Answer: c
H
AT
FILL IN THE BLANKS
M

1. SQL stands for __________.


Answer: Structured Query Language
ED

2. The clause used to sort records in SQL is __________.


Answer: ORDER BY
M

3. The __________ key uniquely identifies each record in a table.


M

Answer: Primary

4. To insert new records in a table, we use the __________ statement.


A

Answer: INSERT INTO


H

5. In MySQL, date values are stored in the format __________.


O

Answer: YYYY-MM-DD
M

6. The __________ clause is used to filter records before grouping.


Answer: WHERE

7. The __________ clause is used to filter grouped records.


Answer: HAVING

8. The wildcard character __________ represents zero or more characters in SQL.


Answer: %

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
16
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

9. To display all columns from a table, we use the symbol __________ in a SELECT statement.
Answer: *

10. The command to remove an entire table from the database is __________.
Answer: DROP TABLE

11. To change the structure of a table, we use the __________ statement.


Answer: ALTER TABLE

12. The __________ constraint ensures a column cannot have NULL values.

R
Answer: NOT NULL

L
13. The __________ function returns the current date and time.
Answer: NOW()

N
14. To define a column with fixed length string data, we use the datatype __________.

EE
Answer: CHAR

15. The __________ datatype stores numeric values with decimal points.
Answer: FLOAT
H
AT
16. The __________ function is used to round off numbers in SQL.
Answer: ROUND()
M

17. __________ is a special value in SQL used to represent missing or unknown information.
Answer: NULL
ED

18. The __________ constraint automatically fills in a column with a predefined value when no
input is given.
M

Answer: DEFAULT

19. To rename a column in the output of a SELECT query, we use the keyword __________.
M

Answer: AS
A

20. The __________ operator is used to check if a column value is within a set of values.
H

Answer: IN
O

21. The __________ function returns the number of characters in a string.


Answer: LENGTH()
M

22. The __________ function removes both leading and trailing spaces from a string.
Answer: TRIM()

23. A composite primary key consists of __________ or more columns.


Answer: two

24. The __________ command is used to view the structure of an existing table.
Answer: DESCRIBE

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
17
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

25. The __________ clause is used with SELECT to retrieve only unique values.
Answer: DISTINCT

26. The __________ constraint ensures all values in a column are different.
Answer: UNIQUE

27. The __________ operator is used to retrieve records where a column value lies within a specific
range.
Answer: BETWEEN

R
28. The __________ function extracts a part of a string.

L
Answer: MID()

29. A column that refers to a primary key in another table is called a __________ key.

N
Answer: foreign

EE
30. The __________ command permanently removes all records from a table and the table structure
itself.
Answer: DROP
H
AT
2 MARKS QUESTIONS
M

1. What is SQL?
Answer: SQL stands for Structured Query Language. It is a language used to create, manipulate, and
ED

retrieve data from relational databases like MySQL, Oracle, SQL Server, etc.

2. Why is SQL considered easy to learn?


M

Answer: SQL is considered easy because its statements are made up of descriptive English words and it
is case-insensitive.
M

3. What is the difference between CHAR and VARCHAR datatypes?


A

Answer: CHAR is a fixed-length datatype that pads unused characters with spaces, while VARCHAR is
H

a variable-length datatype that stores only the required number of characters.


O

4. What is the significance of constraints in SQL?


Answer: Constraints enforce rules on data in a table to ensure accuracy and integrity, such as NOT NULL,
M

UNIQUE, PRIMARY KEY, FOREIGN KEY, and DEFAULT.

5. Give the syntax and an example to create a database named StudentAttendance.


Answer:
Syntax: CREATE DATABASE databasename;
Example: CREATE DATABASE StudentAttendance;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
18
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

6. Differentiate between PRIMARY KEY and FOREIGN KEY.


Answer: A PRIMARY KEY uniquely identifies each record and does not allow NULLs, while a FOR-
EIGN KEY is used to link two tables and refers to the PRIMARY KEY of another table.

7. Write the syntax to create a table in SQL and give an example.


Answer:
Syntax:
CREATE TABLE tablename (column1 datatype constraint, column2 datatype constraint,

R
...);
Example:

L
CREATE TABLE STUDENT(

N
RollNumber INT PRIMARY KEY,
SName VARCHAR(20) NOT NULL,

EE
SDateofBirth DATE,
GUID CHAR(12)
);

H
AT
8. What is the use of the DESCRIBE command in SQL?
Answer: The DESCRIBE or DESC command is used to view the structure of a table including column
names, data types, and constraints.
M

9. What is a composite primary key? Give an example.


Answer: A composite primary key consists of two or more columns used together to uniquely identify a
ED

record.
Example:
M

PRIMARY KEY (AttendanceDate, RollNumber);

10. Give an example to add a foreign key in the STUDENT table.


M

Answer:
A

ALTER TABLE STUDENT


H

ADD FOREIGN KEY(GUID) REFERENCES GUARDIAN(GUID);


O

11. How do you add a new column to an existing table? Give syntax and example.
Answer:
M

Syntax: ALTER TABLE tablename ADD column_name datatype;


Example:
ALTER TABLE GUARDIAN ADD Income INT;

12. Differentiate between DELETE and DROP commands in SQL.


Answer: DELETE removes rows from a table based on a condition but retains the table structure, whereas
DROP permanently deletes the entire table and its structure.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
19
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

13. Write the syntax to insert data into a table and give an example.
Answer:
Syntax: INSERT INTO tablename VALUES (value1, value2, ...);
Example:
INSERT INTO STUDENT VALUES (1, 'Atharv Ahuja', '2003-05-15', 444444444444);

14. What is the use of the SELECT statement? Give a simple example.
Answer: SELECT is used to retrieve data from a table.

R
Example:
SELECT * FROM STUDENT;

L
15. What is the purpose of the DISTINCT clause in a SELECT query?

N
Answer: DISTINCT is used to return only unique (non-duplicate) values in the output of a SELECT
statement.

EE
16. Give the syntax of the ORDER BY clause and state its default order.
Answer:

H
Syntax: SELECT * FROM tablename ORDER BY column_name [ASC|DESC];
AT
Default order is ascending (ASC).

17. What is the difference between WHERE and HAVING clause?


M

Answer: WHERE filters rows before grouping, while HAVING filters groups formed by GROUP BY.

18. Write a query to display employee names and their annual income (Salary * 12), using column
ED

aliases.
Answer:
M

SELECT Ename AS Name, Salary*12 AS 'Annual Income'


FROM EMPLOYEE;
M

19. What does the LIKE operator do in SQL? Give an example.


A

Answer: The LIKE operator is used for pattern matching using wildcards.
Example:
H

SELECT * FROM EMPLOYEE WHERE Ename LIKE 'K%';


O

20. What are single-row functions? Give two examples.


M

Answer: Single-row functions operate on a single value and return a single value.
Examples: UCASE(), ROUND()

3 MARKS QUESTIONS

1. What are the main features of SQL? List any three.


Answer:

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
20
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

1. SQL is a non-procedural, declarative language.


2. It is used for creating and managing relational databases.
3. It is case-insensitive and easy to understand due to English-like syntax.

2. Differentiate between DDL and DML commands with one example each.
Answer:
DDL (Data Definition Language) defines the structure of a database. Example: CREATE TABLE.
DML (Data Manipulation Language) is used to manage data in tables. Example: INSERT INTO.

R
3. Write the syntax of the CREATE TABLE command and give an example to create a STUDENT
table with RollNumber, Name, and DateOfBirth.

L
Answer:

N
Syntax:

EE
CREATE TABLE tablename (column1 datatype, column2 datatype, ...);

Example:

CREATE TABLE STUDENT (


H
AT
RollNumber INT,
Name VARCHAR(25),
DateOfBirth DATE
M

);

4. Explain any three constraints used in SQL.


ED

Answer:
1. NOT NULL – Ensures that a column cannot have NULL values.
M

2. UNIQUE – Ensures that all values in a column are different.


3. PRIMARY KEY – Uniquely identifies each record and does not allow NULLs.
M

5. What is a foreign key? Give its syntax and explain with an example.
A

Answer:
A foreign key is a column that refers to the primary key of another table.
H

Syntax:
O

FOREIGN KEY (column_name) REFERENCES other_table(column_name);


M

Example:

ALTER TABLE STUDENT ADD FOREIGN KEY(GUID) REFERENCES GUARDIAN(GUID);

6. Write a query to insert a record into the GUARDIAN table. Also, write a query to add a new
column Occupation.
Answer:
Insert:

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
21
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

INSERT INTO GUARDIAN VALUES (444444444444, 'Prithvi Raj', 'M', 'Doctor', 1200000);

Add column:

ALTER TABLE GUARDIAN ADD Occupation VARCHAR(30);

7. Write a query to update the salary of employee code 103 to 80000 and delete employee with code
104.
Answer:

R
Update:

L
UPDATE EMPLOYEE SET Salary = 80000 WHERE Ecode = 103;

Delete:

N
DELETE FROM EMPLOYEE WHERE Ecode = 104;

EE
8. What is the difference between DELETE and DROP commands? Give one use case each.
Answer:
H
DELETE removes specific rows but retains the table structure.
AT
Example: DELETE FROM STUDENT WHERE RollNumber = 1;
DROP removes the table structure entirely.
M

Example: DROP TABLE STUDENT;

9. Explain the use of SELECT statement with WHERE and ORDER BY clauses using an example.
ED

Answer:
SELECT retrieves records from a table.
WHERE filters rows based on a condition.
M

ORDER BY sorts the results.


M

Example:

SELECT * FROM EMPLOYEE WHERE Salary > 40000 ORDER BY Ename;


A
H

10. Write a query using DISTINCT to display unique city names from the CUSTOMER table.
Also, explain its use.
O

Answer:
M

Query:

SELECT DISTINCT City FROM CUSTOMER;

Explanation: DISTINCT is used to remove duplicate values from the result set.

11. Differentiate between the WHERE and HAVING clauses with example queries.
Answer:
WHERE filters rows before grouping;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
22
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

HAVING filters groups after grouping.


Example:

SELECT * FROM EMPLOYEE WHERE Salary > 30000;


SELECT DeptID, COUNT(*) FROM EMPLOYEE GROUP BY DeptID HAVING COUNT(*) > 2;

12. Write queries to demonstrate the use of LIKE operator with the patterns:
a) Names starting with ‘A’
b) Names ending with ‘n’

R
c) Names containing ‘sh’
Answer:

L
a) SELECT * FROM EMPLOYEE WHERE Ename LIKE 'A%';

N
b) SELECT * FROM EMPLOYEE WHERE Ename LIKE '%n';
c) SELECT * FROM EMPLOYEE WHERE Ename LIKE '%sh%';

EE
13. What are wildcard characters in SQL? Explain % and _ with suitable examples.
Answer:
Wildcards are used with LIKE for pattern matching.
H
AT
% – Matches zero or more characters.
Example: 'K%' matches ‘Kiran’, ‘Kunal’
M

_ – Matches exactly one character.


Example: 'K_nal' matches ‘Kunal’, not ‘Kiran’
ED

14. Write SQL queries to:


a) Display all records from SALE where SAmount is greater than 200000
b) Display all records between SAmount 150000 and 250000
M

Answer:
a) SELECT * FROM SALE WHERE SAmount > 200000;
M

b) SELECT * FROM SALE WHERE SAmount BETWEEN 150000 AND 250000;


A

15. List any three aggregate functions in SQL with their purpose.
H

Answer:
1. SUM() – Returns total sum of values.
O

2. AVG() – Returns average of values.


M

3. COUNT() – Returns number of records.

16. Write a query using GROUP BY to count the number of employees in each department.
Answer:

SELECT DeptID, COUNT(*) FROM EMPLOYEE GROUP BY DeptID;

17. Explain the use of MOD() and ROUND() functions with examples.
Answer:

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
23
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

MOD(x, y) returns the remainder. Example: MOD(11, 3) returns 2


ROUND(x, y) rounds to ‘y’ decimal places. Example: ROUND(283.28, 1) returns 283.3

18. What does the NOW() function return? Also, write a query to retrieve it.
Answer:
NOW() returns the current date and time.
Query:

SELECT NOW();

R
19. Write the difference between single-row functions and aggregate functions. Give two examples

L
of each.
Answer:

N
Single-row functions operate on each row. Example: UCASE(), ROUND()

EE
Aggregate functions operate on a group of rows. Example: SUM(), MAX()

20. Write queries to:


a) Display names in lowercase
b) Display first 4 characters of Cname H
AT
c) Display length of each name in EMPLOYEE
Answer:
M

a) SELECT LCASE(Ename) FROM EMPLOYEE;


b) SELECT MID(Cname, 1, 4) FROM CUSTOMER;
ED

c) SELECT LENGTH(Ename) FROM EMPLOYEE;


M

5 MARKS QUESTIONS
M

QUESTION 1
Given Table: STUDENT
A
H

RollNumber SName SDateofBirth GUID


O

1 Atharv Ahuja 2003-05-15 444444444444


M

2 Daizy Bhutia 2002-02-28 111111111111


3 Taleem Shah 2002-02-28 NULL

Write SQL queries for the following:

a. Write a CREATE TABLE command to create the STUDENT table with appropriate data types.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
24
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b. Display all students whose names end with ‘Shah’.

c. Count students born after the year 2002.

d. Update the GUID of student with RollNumber 3 to 101010101010.

e. Show the name and birth year of each student.

R
L
ANSWER 1

N
a.

EE
CREATE TABLE STUDENT (
RollNumber INT PRIMARY KEY,
SName VARCHAR(30),
H
AT
SDateofBirth DATE,
GUID CHAR(12)
);
M

b.
ED

SELECT * FROM STUDENT


WHERE SName LIKE '%Shah';
M

c.

SELECT COUNT(*) FROM STUDENT


M

WHERE YEAR(SDateofBirth) > 2002;


A

d.
H

UPDATE STUDENT
O

SET GUID = '101010101010'


WHERE RollNumber = 3;
M

e.

SELECT SName, YEAR(SDateofBirth) AS BirthYear FROM STUDENT;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
25
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

QUESTION 2
Given Table: EMPLOYEE

EmpID Ename Salary DeptId

E001 Alok 25000 D01


E002 Bhavna 30000 D02

R
E003 Chetan 28000 D01

L
Write SQL queries for the following:

N
a. Write the CREATE TABLE command for EMPLOYEE with relevant types.

EE
b. List employees working in department D01.

c. Count number of employees in each department. H


AT
d. Update the salary of ‘Chetan’ to 32000.
M

e. Display employees in descending order of salary.


ED
M

ANSWER 2
M

a.
A

CREATE TABLE EMPLOYEE (


EmpID CHAR(5) PRIMARY KEY,
H

Ename VARCHAR(30),
O

Salary INT,
DeptId CHAR(4)
M

);

b.

SELECT * FROM EMPLOYEE


WHERE DeptId = 'D01';

c.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
26
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

SELECT DeptId, COUNT(*) AS NumEmployees FROM EMPLOYEE


GROUP BY DeptId;

d.

UPDATE EMPLOYEE
SET Salary = 32000
WHERE Ename = 'Chetan';

R
e.

SELECT * FROM EMPLOYEE

L
ORDER BY Salary DESC;

N
EE
QUESTION 3
Given Table: GUARDIAN
H
AT
GUID GName GPhone Income

111111111111 Bhutia 9812345670 420000


M

222222222222 Raj Ahuja NULL 310000


ED

Write SQL queries for the following:


M

a. Create the GUARDIAN table with required fields.


M

b. Display guardian names with NULL phone numbers.


A

c. Count number of guardians with income above 3 lakh.


H
O

d. Update GPhone for GUID 222222222222 to ‘9012345678’.


M

e. Display names sorted by income descending.

ANSWER 3

a.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
27
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CREATE TABLE GUARDIAN (


GUID CHAR(12) PRIMARY KEY,
GName VARCHAR(30),
GPhone CHAR(10),
Income INT
);

b.

R
SELECT GName FROM GUARDIAN
WHERE GPhone IS NULL;

L
c.

N
SELECT COUNT(*) FROM GUARDIAN

EE
WHERE Income > 300000;

d.

UPDATE GUARDIAN
H
AT
SET GPhone = '9012345678'
WHERE GUID = '222222222222';
M

e.

SELECT GName FROM GUARDIAN


ED

ORDER BY Income DESC;


M
M

QUESTION 4
Given Table: INVENTORY
A
H

CarId CarName Price FuelType


O

C01 Swift 525000.00 Petrol


M

C02 EECO 350000.00 CNG

Write SQL queries for the following:

a. Write the CREATE TABLE command for INVENTORY.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
28
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b. Display all Petrol cars.

c. Count cars for each fuel type.

d. Update the price of EECO to 360000.

e. Show car names sorted by price descending.

R
L
ANSWER 4

N
a.

EE
CREATE TABLE INVENTORY (
CarId CHAR(5) PRIMARY KEY,
CarName VARCHAR(30),
H
AT
Price DECIMAL(10,2),
FuelType VARCHAR(10)
);
M

b.
ED

SELECT * FROM INVENTORY


WHERE FuelType = 'Petrol';
M

c.

SELECT FuelType, COUNT(*) FROM INVENTORY


M

GROUP BY FuelType;
A

d.
H

UPDATE INVENTORY
O

SET Price = 360000.00


WHERE CarId = 'C02';
M

e.

SELECT CarName FROM INVENTORY


ORDER BY Price DESC;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
29
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

QUESTION 5
Given Table: SALE

InvoiceNo CarId CustId SalePrice

I001 C01 CU01 600000.00


I002 C02 CU02 540000.00

R
Write SQL queries for the following:

L
a. Write the CREATE TABLE statement for SALE.

N
EE
b. Show all sales above 550000.

c. Count number of cars sold per car ID.

H
AT
d. Update SalePrice for invoice I002 to 550000.

e. Show sale records sorted by price.


M
ED

ANSWER 5
M

a.
M

CREATE TABLE SALE (


InvoiceNo CHAR(5) PRIMARY KEY,
A

CarId CHAR(5),
CustId CHAR(5),
H

SalePrice DECIMAL(10,2)
O

);
M

b.

SELECT * FROM SALE


WHERE SalePrice > 550000;

c.

SELECT CarId, COUNT(*) AS TotalSold FROM SALE


GROUP BY CarId;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
30
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

d.

UPDATE SALE
SET SalePrice = 550000.00
WHERE InvoiceNo = 'I002';

e.

SELECT * FROM SALE


ORDER BY SalePrice;

R
L
N
QUESTION 6

EE
Given Table: CUSTOMER

CustId CustName CustAdd Phone Email

H
AT
C001 Ananya Sen Lajpat Nagar 9811122233 [email protected]
C002 Ravi Verma Rohini Sector 3 9822233344 [email protected]
M

Write SQL queries for the following:


ED

a. Write the CREATE TABLE command for CUSTOMER.


M

b. Display names of customers who live in ‘Rohini’.


M

c. Count customers with Gmail addresses.


A

d. Update the phone number of ‘Ravi Verma’ to ‘9876543210’.


H
O

e. Show all customers sorted alphabetically by name.


M

ANSWER 6

a.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
31
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CREATE TABLE CUSTOMER (


CustId CHAR(5) PRIMARY KEY,
CustName VARCHAR(50),
CustAdd VARCHAR(100),
Phone CHAR(10),
Email VARCHAR(50)
);

b.

R
SELECT CustName FROM CUSTOMER

L
WHERE CustAdd LIKE '%Rohini%';

N
c.

EE
SELECT COUNT(*) FROM CUSTOMER
WHERE Email LIKE '%gmail.com';

d.
H
AT
UPDATE CUSTOMER
SET Phone = '9876543210'
WHERE CustName = 'Ravi Verma';
M

e.
ED

SELECT * FROM CUSTOMER


ORDER BY CustName;
M
M

QUESTION 7
A

Given Table: PRODUCT


H

ProdID ProdName Price Stock


O

P01 Monitor 8000 10


M

P02 Keyboard 1200 30

Write SQL queries for the following:

a. Create the PRODUCT table with correct data types.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
32
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

b. Display all products with stock more than 20.

c. Count number of products priced over 5000.

d. Update stock of ‘Monitor’ to 12.

e. Show product names sorted by price.

R
L
ANSWER 7

N
a.

EE
CREATE TABLE PRODUCT (
ProdID CHAR(5) PRIMARY KEY,
ProdName VARCHAR(30),
H
AT
Price INT,
Stock INT
);
M

b.
ED

SELECT * FROM PRODUCT


WHERE Stock > 20;
M

c.

SELECT COUNT(*) FROM PRODUCT


M

WHERE Price > 5000;


A

d.
H

UPDATE PRODUCT
O

SET Stock = 12
WHERE ProdName = 'Monitor';
M

e.

SELECT ProdName FROM PRODUCT


ORDER BY Price;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
33
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

QUESTION 8
Given Table: BOOK

BookID Title Author Price

B101 Python Programming Sumita Arora 450


B102 Data Structures Narayana 550

R
Write SQL queries for the following:

L
a. Write the CREATE TABLE statement for BOOK.

N
EE
b. Show titles priced above 500.

c. Count books written by ‘Sumita Arora’.

H
AT
d. Update price of ‘Python Programming’ to 500.

e. Display books sorted by title.


M
ED

ANSWER 8
M

a.
M

CREATE TABLE BOOK (


BookID CHAR(5) PRIMARY KEY,
A

Title VARCHAR(50),
Author VARCHAR(50),
H

Price INT
O

);
M

b.

SELECT Title FROM BOOK


WHERE Price > 500;

c.

SELECT COUNT(*) FROM BOOK


WHERE Author = 'Sumita Arora';

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
34
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

d.

UPDATE BOOK
SET Price = 500
WHERE Title = 'Python Programming';

e.

SELECT * FROM BOOK


ORDER BY Title;

R
L
N
QUESTION 9

EE
Given Table: SUPPLIER

SupplierID Name City

H
AT
S001 Ram Traders Delhi
S002 Om Supplies Gurgaon
M

Write SQL queries for the following:


ED

a. Create the SUPPLIER table.


M

b. Show all suppliers in Delhi.


M

c. Count number of suppliers in Gurgaon.


A

d. Update city of ‘Om Supplies’ to ‘Noida’.


H
O

e. Display supplier names in reverse alphabetical order.


M

ANSWER 9

a.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
35
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CREATE TABLE SUPPLIER (


SupplierID CHAR(5) PRIMARY KEY,
Name VARCHAR(50),
City VARCHAR(50)
);

b.

SELECT * FROM SUPPLIER

R
WHERE City = 'Delhi';

L
c.

SELECT COUNT(*) FROM SUPPLIER

N
WHERE City = 'Gurgaon';

EE
d.

UPDATE SUPPLIER
SET City = 'Noida'
H
AT
WHERE Name = 'Om Supplies';

e.
M

SELECT * FROM SUPPLIER


ORDER BY Name DESC;
ED
M

QUESTION 10
M

Given Table: ATTENDANCE


A

RollNo Date Status


H

1 2024-08-01 P
O

2 2024-08-01 A
M

Write SQL queries for the following:

a. Write the CREATE TABLE command for ATTENDANCE.

b. Show all students who were present.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
36
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

c. Count number of absent students.

d. Update status of RollNo 2 to ‘P’.

e. List attendance sorted by RollNo.

R
ANSWER 10

L
a.

N
CREATE TABLE ATTENDANCE (

EE
RollNo INT,
Date DATE,
Status CHAR(1)
);
H
AT
b.

SELECT * FROM ATTENDANCE


M

WHERE Status = 'P';

c.
ED

SELECT COUNT(*) FROM ATTENDANCE


WHERE Status = 'A';
M

d.
M

UPDATE ATTENDANCE
SET Status = 'P'
A

WHERE RollNo = 2 AND Date = '2024-08-01';


H

e.
O

SELECT * FROM ATTENDANCE


M

ORDER BY RollNo;

QUESTION 11
Given Table: MARKS

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
37
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

RollNo Subject Marks

1 Math 85
2 Math 78
1 Science 90

R
Write SQL queries for the following:

L
a. Create the MARKS table.

N
b. Find the average marks in Math.

EE
c. Show maximum marks scored in Science.

d. Update marks of RollNo 2 in Math to 82.


H
AT
e. List all marks sorted by RollNo and Subject.
M
ED

ANSWER 11

a.
M

CREATE TABLE MARKS (


M

RollNo INT,
Subject VARCHAR(30),
A

Marks INT
);
H
O

b.
M

SELECT AVG(Marks) AS AvgMarks FROM MARKS


WHERE Subject = 'Math';

c.

SELECT MAX(Marks) AS MaxScience FROM MARKS


WHERE Subject = 'Science';

d.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
38
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

UPDATE MARKS
SET Marks = 82
WHERE RollNo = 2 AND Subject = 'Math';

e.

SELECT * FROM MARKS


ORDER BY RollNo, Subject;

R
L
QUESTION 12

N
Given Table: PRODUCT

EE
ProdID Name Price Quantity

P01 Pen
H
10 100
AT
P02 Notebook 50 80
M

Write SQL queries for the following:

a. Write the CREATE TABLE query for PRODUCT.


ED

b. Calculate total stock value for each product (Price × Quantity).


M

c. Find the highest product price.


M

d. Update quantity of Pen to 120.


A
H

e. List all products sorted by name.


O
M

ANSWER 12

a.

CREATE TABLE PRODUCT (


ProdID CHAR(5) PRIMARY KEY,
Name VARCHAR(30),

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
39
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

Price INT,
Quantity INT
);

b.

SELECT Name, (Price * Quantity) AS StockValue FROM PRODUCT;

c.

R
SELECT MAX(Price) AS MaxPrice FROM PRODUCT;

L
d.

N
UPDATE PRODUCT
SET Quantity = 120

EE
WHERE Name = 'Pen';

e.

SELECT * FROM PRODUCT H


AT
ORDER BY Name;
M
ED

QUESTION 13
Given Table: SALES
M

SaleID Item Amount


M

S001 Pen 200


A

S002 Notebook 800


H

S003 Pen 150


O

Write SQL queries for the following:


M

a. Create the SALES table.

b. Find total sales amount for ‘Pen’.

c. Find the number of sales entries for ‘Notebook’.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
40
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

d. Update amount of SaleID S003 to 180.

e. Display sales sorted by amount descending.

ANSWER 13

R
a.

L
CREATE TABLE SALES (
SaleID CHAR(5) PRIMARY KEY,

N
Item VARCHAR(30),
Amount INT

EE
);

b.

SELECT SUM(Amount) AS TotalPenSales FROM SALES H


AT
WHERE Item = 'Pen';
M

c.

SELECT COUNT(*) FROM SALES


ED

WHERE Item = 'Notebook';

d.
M

UPDATE SALES
SET Amount = 180
M

WHERE SaleID = 'S003';


A

e.
H

SELECT * FROM SALES


ORDER BY Amount DESC;
O
M

QUESTION 14
Given Table: ATTENDANCE

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
41
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

Date RollNo Status

2024-08-01 1 P
2024-08-01 2 A
2024-08-02 1 P

R
Write SQL queries for the following:

L
a. Write the CREATE TABLE statement for ATTENDANCE.

N
b. Count how many days RollNo 1 was present.

EE
c. Count total records for each attendance status.

d. Update status of RollNo 2 on 2024-08-01 to ‘P’.


H
AT
e. Show all records sorted by date then roll number.
M
ED

ANSWER 14

a.
M

CREATE TABLE ATTENDANCE (


M

Date DATE,
RollNo INT,
A

Status CHAR(1)
);
H
O

b.
M

SELECT COUNT(*) AS DaysPresent FROM ATTENDANCE


WHERE RollNo = 1 AND Status = 'P';

c.

SELECT Status, COUNT(*) AS Count FROM ATTENDANCE


GROUP BY Status;

d.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
42
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

UPDATE ATTENDANCE
SET Status = 'P'
WHERE RollNo = 2 AND Date = '2024-08-01';

e.

SELECT * FROM ATTENDANCE


ORDER BY Date, RollNo;

R
L
QUESTION 15

N
Given Table: EMPLOYEE

EE
EmpID Name Salary

E01 Aarav
H 45000
AT
E02 Tanya 50000
E03 Rohan 42000
M

Write SQL queries for the following:


ED

a. Create the EMPLOYEE table.


M

b. Find average salary.


M

c. Find minimum salary.


A

d. Update salary of ‘Rohan’ to 46000.


H
O

e. List employees sorted by salary descending.


M

ANSWER 15

a.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
43
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CREATE TABLE EMPLOYEE (


EmpID CHAR(5) PRIMARY KEY,
Name VARCHAR(30),
Salary INT
);

b.

SELECT AVG(Salary) AS AvgSalary FROM EMPLOYEE;

R
c.

L
SELECT MIN(Salary) AS MinSalary FROM EMPLOYEE;

N
d.

EE
UPDATE EMPLOYEE
SET Salary = 46000
WHERE Name = 'Rohan';

H
AT
e.

SELECT * FROM EMPLOYEE


M

ORDER BY Salary DESC;


ED

QUESTION 16
M

Given Table: GUARDIAN


M

GUID GName Income


A

G001 Aman Kumar 420000


H

G002 Rekha Singh 390000


O

G003 D’Souza 280000


M

Write SQL queries for the following:

a. Write the CREATE TABLE command for GUARDIAN.

b. Find the average income of all guardians.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
44
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

c. Count the number of guardians earning more than Rs.3 lakh.

d. Update the income of G003 to Rs.310000.

e. Display all guardians in descending order of income.

R
ANSWER 16

L
a.

N
CREATE TABLE GUARDIAN (

EE
GUID CHAR(5) PRIMARY KEY,
GName VARCHAR(50),
Income INT
);
H
AT
b.

SELECT AVG(Income) AS AverageIncome FROM GUARDIAN;


M

c.
ED

SELECT COUNT(*) AS CountAbove3Lakh FROM GUARDIAN


WHERE Income > 300000;
M

d.

UPDATE GUARDIAN
M

SET Income = 310000


WHERE GUID = 'G003';
A
H

e.
O

SELECT * FROM GUARDIAN


ORDER BY Income DESC;
M

QUESTION 17
Given Table: LIBRARY

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
45
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

BookID Title Price

B001 DBMS Concepts 450


B002 Python Programming 500
B003 Java Basics 475

R
Write SQL queries for the following:

L
a. Write the CREATE TABLE command for LIBRARY.

N
b. Find the total cost of all books.

EE
c. Display the most expensive book.

d. Update the price of ‘DBMS Concepts’ to 470.


H
AT
e. Show books in ascending order of title.
M
ED

ANSWER 17

a.
M

CREATE TABLE LIBRARY (


M

BookID CHAR(5) PRIMARY KEY,


Title VARCHAR(100),
A

Price INT
);
H
O

b.
M

SELECT SUM(Price) AS TotalCost FROM LIBRARY;

c.

SELECT * FROM LIBRARY


ORDER BY Price DESC
LIMIT 1;

d.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
46
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

UPDATE LIBRARY
SET Price = 470
WHERE Title = 'DBMS Concepts';

e.

SELECT * FROM LIBRARY


ORDER BY Title ASC;

R
L
QUESTION 18

N
Given Table: PURCHASE

EE
PurchaseID Item Quantity Rate

P001 Pencil
H 100 5
AT
P002 Eraser 50 3
P003 Sharpener 60 6
M

Write SQL queries for the following:


ED

a. Create the PURCHASE table.


M

b. Calculate total quantity of items purchased.


M

c. Find maximum rate among all items.


A

d. Update quantity of Eraser to 70.


H
O

e. Show all purchase entries sorted by item name.


M

ANSWER 18

a.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
47
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

CREATE TABLE PURCHASE (


PurchaseID CHAR(5) PRIMARY KEY,
Item VARCHAR(30),
Quantity INT,
Rate INT
);

b.

R
SELECT SUM(Quantity) AS TotalQuantity FROM PURCHASE;

L
c.

SELECT MAX(Rate) AS HighestRate FROM PURCHASE;

N
d.

EE
UPDATE PURCHASE
SET Quantity = 70
WHERE Item = 'Eraser';
H
AT
e.

SELECT * FROM PURCHASE


M

ORDER BY Item;
ED

QUESTION 19
M

Given Table: ORDERS


M

OrderID Customer Amount


A

O001 Aaliya 4500


H

O002 Tanya 5000


O

O003 Rohan 4200


M

Write SQL queries for the following:

a. Create the ORDERS table.

b. Show total order amount.

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
48
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

c. Count how many customers ordered more than Rs.4500.

d. Update amount of OrderID O003 to 4600.

e. Show all orders sorted by amount descending.

R
ANSWER 19

L
a.

N
CREATE TABLE ORDERS (

EE
OrderID CHAR(5) PRIMARY KEY,
Customer VARCHAR(30),
Amount INT
);
H
AT
b.

SELECT SUM(Amount) AS TotalOrders FROM ORDERS;


M

c.
ED

SELECT COUNT(*) FROM ORDERS


WHERE Amount > 4500;
M

d.

UPDATE ORDERS
M

SET Amount = 4600


WHERE OrderID = 'O003';
A
H

e.
O

SELECT * FROM ORDERS


ORDER BY Amount DESC;
M

QUESTION 20
Given Table: CLASSMARKS

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
49
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

RollNo Subject Marks

101 English 88
102 English 92
103 English 80

R
Write SQL queries for the following:

a. Create the CLASSMARKS table.

L
N
b. Find average marks in English.

EE
c. Find minimum marks in the subject.

d. Update marks of RollNo 103 to 85.


H
AT
e. Display all marks sorted by highest to lowest.
M
ED

ANSWER 20

a.
M

CREATE TABLE CLASSMARKS (


RollNo INT,
M

Subject VARCHAR(30),
Marks INT
A

);
H

b.
O

SELECT AVG(Marks) AS AverageMarks FROM CLASSMARKS;


M

c.

SELECT MIN(Marks) AS LowestMarks FROM CLASSMARKS;

d.

UPDATE CLASSMARKS
SET Marks = 85
WHERE RollNo = 103;

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
50
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

e.

SELECT * FROM CLASSMARKS


ORDER BY Marks DESC;

CHAPTER END EXERCISES

R
Exercise 1: Answer the following questions

L
a) RDBMS stands for Relational Database Management System.

N
Two RDBMS software: MySQL, Oracle

EE
b)
- ORDER BY: Sorts query results based on one or more columns.
- GROUP BY: Groups rows with identical values for aggregate functions.

c) H
AT
Single Row Functions Aggregate Functions
M

Work on one row at a time Work on a group of rows


ED

Return one result per row Return one result for entire group
M

d) Cartesian Product: The result of combining every row from one table with every row from another
table.
M

e)
A

- ALTER changes table structure.


- UPDATE changes table content.
H

- DELETE removes specific rows.


O

- DROP removes entire table.


M

f)
i) DAYNAME()
ii) MID() or SUBSTRING()
iii) MONTHNAME()
iv) UPPER() or UCASE()

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
51
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

Exercise 2: Write the output produced by the following SQL statements

a)

SELECT POW(2,3);

→8

b)

SELECT ROUND(342.9234,-1);

R
→ 340

L
c)

N
SELECT LENGTH("Informatics Practices");

EE
→ 23

d)
H
SELECT YEAR("1979/11/26"), MONTH("1979/11/26"), DAY("1979/11/26"),
AT
↪ MONTHNAME("1979/11/26");

→ 1979, 11, 26, November


M

e)
ED

SELECT LEFT("INDIA",3), RIGHT("Computer Science",4), MID("Informatics",3,4),


↪ SUBSTR("Practices",3);

→ IND, ence, form, actices


M
M
A

Exercise 3: Based on MOVIE Table


H

Given table MOVIE with columns: MovieID, MovieName, Category, ReleaseDate, ProductionCost, Busi-
O

nessCost
M

a)

SELECT * FROM MOVIE;

b)

SELECT MovieID, MovieName, (ProductionCost + BusinessCost) AS Total_Earning FROM


↪ MOVIE;

c)

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
52
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

SELECT DISTINCT Category FROM MOVIE;

d)

SELECT MovieID, MovieName, (BusinessCost - ProductionCost) AS NetProfit FROM MOVIE;

e)

SELECT MovieID, MovieName, ProductionCost FROM MOVIE WHERE ProductionCost > 10000 AND
↪ ProductionCost < 100000;

R
f)

L
SELECT * FROM MOVIE WHERE Category IN ('Comedy', 'Action');

N
g)

EE
SELECT * FROM MOVIE WHERE ReleaseDate IS NULL;

H
AT
Exercise 4: Creating and Modifying Tables in SPORTS Database
M

a)

CREATE DATABASE Sports;


ED

b)

CREATE TABLE TEAM (


M

TeamID INT CHECK(TeamID BETWEEN 1 AND 9),


TeamName VARCHAR(50) CHECK(LENGTH(TeamName) >= 10),
M

PRIMARY KEY (TeamID)


);
A

c) Already included with PRIMARY KEY on TeamID.


H

d)
O

DESC TEAM;
M

e)

INSERT INTO TEAM VALUES


(1, 'Team Titan'),
(2, 'Team Rockers'),
(3, 'Team Magnet'),
(4, 'Team Hurricane');

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
53
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

f)

SELECT * FROM TEAM;

g)

CREATE TABLE MATCH_DETAILS (


MatchID CHAR(3) PRIMARY KEY,
MatchDate DATE,
FirstTeamID INT,

R
SecondTeamID INT,
FirstTeamScore INT,

L
SecondTeamScore INT
);

N
EE
Exercise 5: Queries on MATCH_DETAILS Table
H
AT
a)

SELECT MatchID FROM MATCH_DETAILS WHERE FirstTeamScore > 70 AND SecondTeamScore > 70;
M

b)

SELECT MatchID FROM MATCH_DETAILS WHERE FirstTeamScore < 70 AND SecondTeamScore > 70;
ED

c)
M

SELECT MatchID, MatchDate FROM MATCH_DETAILS WHERE FirstTeamID = 1 AND FirstTeamScore


↪ > SecondTeamScore;
M

d)
A

SELECT MatchID FROM MATCH_DETAILS WHERE FirstTeamID = 2 AND FirstTeamScore <


↪ SecondTeamScore;
H

e)
O

ALTER TABLE TEAM RENAME TO T_DATA;


M

ALTER TABLE T_DATA CHANGE TeamID T_ID INT;


ALTER TABLE T_DATA CHANGE TeamName T_NAME VARCHAR(50);

Exercise 6: SCHOOLUNIFORM Database Constraints

a) Insert handkerchief:

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
54
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

INSERT INTO UNIFORM VALUES (7, 'Handkerchief', 'Red');


INSERT INTO COST VALUES (7, 'M', 100);

b) Enforce referential integrity:

ALTER TABLE COST ADD CONSTRAINT FK_UCode FOREIGN KEY (UCode) REFERENCES
↪ UNIFORM(UCode);

c) Valid UName constraint:

R
ALTER TABLE UNIFORM ADD CONSTRAINT chk_UName CHECK (UName IS NOT NULL);

L
d) Price must be > 0:

ALTER TABLE COST ADD CONSTRAINT chk_price_gt_zero CHECK (Price > 0);

N
EE
Exercise 7: Product Table Operations
H
AT
a)

CREATE TABLE Product (


M

PCode CHAR(4) PRIMARY KEY,


PName VARCHAR(30),
UPrice INT,
ED

Manufacturer VARCHAR(30)
);
M

b) Primary Key: PCode


M

c)

SELECT PCode, PName, UPrice FROM Product ORDER BY PName DESC, UPrice ASC;
A
H

d)
O

ALTER TABLE Product ADD Discount INT;


M

e)

UPDATE Product SET Discount = 0;


UPDATE Product SET Discount = 10 WHERE UPrice > 100;

OR

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
55
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

UPDATE Product SET Discount =


CASE
WHEN UPrice > 100 THEN UPrice * 0.10
ELSE 0
END;

f)

UPDATE Product SET UPrice = UPrice * 1.12 WHERE Manufacturer = 'Dove';

R
g)

L
SELECT Manufacturer, COUNT(*) FROM Product GROUP BY Manufacturer;

N
h)

EE
SELECT PName, AVG(UPrice) FROM Product GROUP BY PName;

i)

SELECT DISTINCT Manufacturer FROM Product; H


AT
j)
M

SELECT COUNT(DISTINCT PName) FROM Product;

k)
ED

SELECT PName, MAX(UPrice), MIN(UPrice) FROM Product GROUP BY PName;


M
M

Exercise 8: Queries on CARSHOWROOM - INVENTORY Table


A

a)
H

ALTER TABLE INVENTORY ADD Discount INT;


O

b)
M

UPDATE INVENTORY SET Discount =


CASE
WHEN Model = 'LXI' THEN 0
WHEN Model = 'VXI' THEN Price * 0.10
ELSE Price * 0.12
END;

or

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
56
Q & A || CHAPTER 9 STRUCTURED QUERY LANGUAGE (SQL) April 25, 2025

UPDATE INVENTORY SET Discount = 0 WHERE Model = 'LXI';


UPDATE INVENTORY SET Discount = 10 WHERE Model = 'VXI';
UPDATE INVENTORY SET Discount = 12 WHERE Model NOT IN (LXI', VXI');

c)

SELECT CarName FROM INVENTORY WHERE FuelType = 'Petrol' ORDER BY Price DESC LIMIT 1;

d)

R
SELECT AVG(Discount), SUM(Discount) FROM INVENTORY WHERE CarName = 'Baleno';

L
e)

N
SELECT COUNT(*) FROM INVENTORY WHERE Discount = 0;

EE
For more information Visit:

https://matheenhere.blogspot.com

H
AT
M
ED
M
M
A
H
O
M

L R MOHAMMED MATHEEN M.C.A., M.A., B.ED., UGC NET.,


LECTURER, PRIMUS PU COLLEGE, BANGALORE - 560 035
57

You might also like