12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 13/09/2022
QB365 provides a detailed and simple solution for every Possible Creative Questions in Class 12 Computer Science Subject - Data Manipulation Through SQL , English Medium. It will help Students to get more practice questions, Students can Practice these question papers in addition to score best marks.
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
With an example,program explains briefly about SQL DISTINCT CLAUSE.
2.
Explain briefly about cursor( ) method of connection?
3.
Write a program to display the content of tuples in new line without using loops.
4.
How will display record using fetchmany( )?
5.
How will you display a record using fetchone ( )?
6.
How will you display a record using fetch one ( )?
7.
How will you display all records using fetch all ( )?
8.
How will you create database using SQ Lite?
9.
List the classes used in the SQL SELECT statement.
10.
Write a note on SELECT statement in SQL.
11.
What is the purpose of using
(i) COUNT ( )
(ii) AVG ( )
(iii) SUM ( )
(iv) MAX ( )
(v) MIN ( )
12.
What is the use of aggregate functions used along with SELECT statement? What are they?
13.
Explain how a connect to be made to a database (Academy through python SQlite3.
14.
Write the sqlite steps to connect the database.
15.
Explain how the SELECT statement can be used along with GROUP BY class.
1.
The distinct clause is helpful when there is a need of avoiding the duplicate values present in any specific columns/table. When we use distinct keywords only the unique values are fetched. In this example, we are going to display the different grades scored by students from the "student table".
Example:
import Sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor ( )
cursor.execute ("SELECT DISTINCT(Grade) FROM student")
result = cursor.fetchall ( )
print (result)
Output:
[('B',), ('A',), ('C',), ('D',)]
2.
The cursor object is created by calling the cursor() method of connection. The cursor is used to traverse the records from the result set. We can define a SQL command with a triple quoted string in Python. The reason behind the triple quotes is sometimes the values in the table might contain single or double quotes.
3.
import sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor ( )
cursor.execute ("SELECT *FROM student")
print("fetching first 3 records:")
result = cursor.fetchmany(3)
print(* result, sep= '\n")
Output:
fetching first 3 records
(1, 'Akshay', 'B', 'M',87.8, '2001-1212')
(2, 'Aravind', 'A', 'M', 92.5, '2000-08-17')
(3, 'Basker', 'C', 'M', 95.2, '1999-05-17')
4.
Display specified number of records is done by using fetchmany( ). This method returns the next number of rows(n) of the result set.
Example:
import sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor( )
cursor.execute ("SELECT *FROM student")
print("fetching first 3 records:")
result= cursor.fetchmany(3)
print(result)
Output:
fetching first 3 records:
[(1, 'Akshay', 'B', 'M',87.8, '2001-1212'),
(2, 'Aravind', 'A', 'M', 92.5, '2000-08-17'),
(3, 'Basker', 'C', 'M', 75.2, '1999-05-17')]
5.
Using the while loop and fetch one method we can display all the records from a table one by one.
Example:
import sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor ( )
cursor.execr,rte ("SELECT *FROM student")
print("fetching all records one by one :")
print(result)
result = cursor.fetchone( )
Output:
fetching all records one by one:
(1, 'Akshay', 'B', 'M', 87.8, '2001-1212')
(2, 'Aravind', 'B', 'M', 92.5, '2000-08-17')
(3, 'BASKER', 'C', 'M', 95.2, '1999-05-17')
(4, 'SAJINI', 'A', 'F', 95.6, '2002-11-01')
(5, 'VARUN', 'B', 'M', 80.6, '2002-03-14')
6.
The fenchone( ) method returns the next rows of a query result set or none in case there is no row left.
Example:
import sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor ( )
cursor.execr,rte ("SELECT *FROM student")
print("\n fetchone:")
res = cursor.fetchone( )
print(res)
Output:
fetchone:
(1, 'Akshay', 'B', 'M',87.8, '2001-1212')
7.
The fetchall ( ) method is used to fetch all rows from the database table.
Example:
import Sqlite3
connection = sqlite3.connect (''Academy.db'')
cursor = connection.cursor( )
cursor.execute ("SELECT * FROM student")
print("fetchalI:")
result = cursor.fetchall ( )
for r in result:
print (r)
Output:
fetchall:
(1, 'Akshay', 'B', 'M', 87.8, '2001-1212')
(2, 'Aravind', 'B', 'M', 92.5, '2000-08-17')
(3, 'Basker', 'C', 'M', 95.2, '1999-05-17')
(4, 'SAJINI', 'A', 'F', 95.6, '2002-11-01')
(5, 'VARUN', 'B', 'M', 80.6, '2002-03-14')
8.
A condition to be made to the database through Python Sqlite3.
#Python code to demonstrate table creation and insertions with SQL.
#importing module.
import sqlite3
#connecting to the database.
connection - sqlite3. connect ("Academy.db")
#cursor
Cursor = Connection. Cursor( )
A database with the name "Academy" would be created. It's similar to the SQL command "CREATE DATABASE Academy;" to the SQL Server. "Sqlite3. connect ('Academy. db')" is again used some program, "connect" command just open the already created database.
9.
(i) DISTINCT
(ii) WHERE
(iii) GROUP BY
(iv) ORDER BY.
(v) HAVING
10.
(i) "SELECT" is the most commonly used statement in SQL.
(ii) The SELECT Statement in SQL is used to retrieve or fetch data from a table in a database.
(iii) The syntax for using this statement is "Select * from table_name" and all the table data can be fetched in an object in the form of list of lists. List the classes used in
11.
(I) COUNT ( ) function returns the number of rows in a table.
(ii) AVG ( ) function retrieves the average of a selected column of rows in a table.
(iii) SUM ( ) function retrieves the sum of a selected column of rows in a table.
(iv) MAX( ) function returns the largest value of the selected column.
(v) MIN( ) function returns the smallest value of the selected column.
12.
Aggregate functions are used to do operations from the values of the column and a single value is returned.
(i) COUNT ( )
(ii) AVG ( )
(iii) SUM ( )
(iv) MAX ( )
(v) MIN ( )
13.
# Python code to demonstrate table creation and insertions with SQL
# importing module
import sqlite3
# connecting to the database
connection = sqlite3.connect ("Academy.db")
# cursor
cursor = connection.cursor ( )
14.
Step 1: Import sqlite3
Step 2: Create a connection using connect o method and pass the name of the database File
Step 3: Set the cursor object cursor = connection. cursor ( )
15.
(i) The SELECT statement can be used along with GROUP BY clause.
(ii) The GROUP BY clause groups records into summary rows. It returns one records for each group.
(iii) It is often used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result -set by one or more columns.
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards