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: 01/11/2019
Data Manipulation Through SQL
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.
Which method is SQlite is used create a connection with a database file created?
cursor ( )
lite ( )
connect ( )
connection ( )
2.
Which of the following clause avoide the duplicate?
Distinct
Remove
Where
GroupBy
3.
The function that returns the largest value of the selected column is
MAX()
LARGE()
HIGH()
MAXIMUM()
4.
Which of the following executes the SQL command to perform some action?
Execute()
Key()
Cursor()
run()
5.
Which of the following is an organized collection of data?
Database
DBMS
Information
Records
6.
What is master table?
7.
Which method is used to fetch all rows from the database table?
8.
What is the advantage of declaring a column as “INTEGER PRIMARY KEY”
9.
Mention the users who uses the Database.
10.
List the classes used in the SQL SELECT statement.
11.
Read the following details.Based on that write a python script to display records in desending order of
Eno
database name :- organization.db
Table name :- Employee
Columns in the table :- Eno, EmpName, Esal, Dept
12.
13.
What is SQLite?What is it advantage?
14.
Consider the following table Supplier and item .Write a python script for (i) to (ii)
| SUPPLIER | ||||
| Suppno | Name | City | Icode | SuppQty |
| S001 | Prasad | Delhi | 1008 | 100 |
| S002 | Anu | Bangalore | 1010 | 200 |
| S003 | Shahid | Bangalore | 1008 | 175 |
| S004 | Akila | Hydrabad | 1005 | 195 |
| S005 | Girish | Hydrabad | 1003 | 25 |
| S006 | Shylaja | Chennai | 1008 | 180 |
| S007 | Lavanya | Mumbai | 1005 | 325 |
i) Display Name, City and Itemname of suppliers who do not reside in Delhi.
ii) Increment the SuppQty of Akila by 40
15.
hat is the use of HAVING clause. Give an example python script
16.
Write in brief about SQLite and the steps used to use it.
1.
(c)
connect ( )
2.
(a)
Distinct
3.
(a)
MAX()
4.
(a)
Execute()
5.
(a)
Database
6.
SQlite_master is the master table which holds the key information about your database tables.
7.
The fetchall() method is used to fetch all rows from the database table.
result = cursor. fetchall()
8.
If a column of a table is declared to be an INTEGER PRIMARY KEY, then whenever a NULL is used as an input for this column, the NULL will be automatically converted into an integer which will be one larger than the highest value so far used in that column.
9.
Users of database can be human users or programmers, other programs or applications.
10.
(i) DISTINCT
(ii) WHERE
(iii) GROUP BY
(iv) ORDER BY.
(v) HAVING
11.
Program: Display the records in descending order using python script
import mysqldb
db = mysqldb.connect ("local host", "user", "123", "organization")
cursor = db.cursor()
cursor.execute ("SELECT *FROM Employee ORDER BY Name DESC")
result = cursor.fetchall()
for row in results:
ENO = row[0], EmpName = row[1], EmpDept = row[2]
print ENO, EmpName, EmpDept
db.close()
12.
13.
(i) SQLite is a simple relational database system, which saves its data in regular data files or even in the internal memory of the computer.
(ii) It is designed to be embedded in applications, instead of using a separate database server program such as MySQL or Oracle.
Advantages:
SQLite is fast, rigorously tested, and flexible, making it easier to work.
Python has a native library for SQLite.
14.
(i) Program to Display Name, city and Item Name of suppliers who do not reside in Delhi:
import mysqldb
db = mysqlkdb.Connect ("Supplier.db")
cursor = db.cursor()
cursor. execute ("'SELECT NAME, CITY, ICode FROM Supplier WHERE CITY <> "Delh")
db. commit()
result=cursor.fetchall()
print ("result, sep = "\n")
db. close()
(ii) Program to Increment the suppQty of Akila by 40:
import mysqldb
db = mysqldb.Connect ("ltem.db"')
cursor = db.cursor()
cursor. execute ("UPDATE Item SET Name = 'Akila' WHERE SuppQty = 235)
db. commit()
cursor. execute ("SELECT * FROM Item")
result = cursor.fetchall()
print ("result, sep ="\n")
db. close()
15.
HAVING clause is used to filter data based on7the group functions. This is similar to WHERE condition but can be used , only with group functions. Group functions cannot be used in WHERE Clause but can be used in HAVING clause.
Example:
import sqlite3
connection = sqlite3.connect("Academy.db")
cursor = connection.cursorO
cursor.execute("SELECT GENDER,COUNT(GENDER) FROM Student GROUP BY GENDER HAVING COUNT( GENDER> 3")
result = cursor.fetchall( )
co = [i[o] for i in cursor. description]
print(co)
print(result)
Output:
['gender', 'COUNT(GENDER)']
[('M', 5)]
16.
(i) SQLite is a simple relational database system, which saves its data in regular data files or even in the internal memory of the computer.
(ii) It is designed to be embedded in applications, instead of using a separate
database server program such as MySQL or Oracle.
(iii) SQLite is fast, rigorously tested, and flexible, making it easier to work. Python
has a native library for SQLite.
To use SQLite,
Step 1: import sqlite3
Step 2: create a connection using connect() method and pass the name of the database file
Step 3: Set the cursor object cursor = connection. cursor()
(iv) Connecting to a database in step 2 means passing the name of the database to be accessed. If the database already exists the connection will open the same. Otherwise, Python will open a new database file with the specified name.
(v) Cursor in step 3 is a control structure used to traverse and fetch the records of the database.
(vi) Cursor has a major role in working with Python. All the commands will be executed using cursor object only.
(vii) To create a table in the database, create an object and write the SQL command in it.
Example: sql_comm = "SQL statement"
(viii) For executing the command use the cursor method and pass the required sql command as a parameter. Many number of commands can be stored in the sql comm and can be executed one after other.
(ix) Any changes made in the values of the record should be saved by the commend "Commit" before closing the "Table connection" .
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