Aissce Computer Science Sample Practical Questions
Aissce Computer Science Sample Practical Questions
Aissce Computer Science Sample Practical Questions
Result:
Thus the above python program has been executed and the output is verified successfully.
Q2. Consider the tables Clients and write SQL commands for questions (1) to (4). [4]
TABLE : CLIENTS
C_ID CLIENTNAME CITY P_ID
1 COSMETIC SHOP KOLKATA BW05
6 TOTAL HEALTH MUMBAI MC01
12 LIVE LIFE KOLKATA CO06
15 PRETTY WOMAN KOLKATA BW12
16 DREAMS BANGALORE RP01
[
Queries to execute before the select command:
[
QUERIES TO DO IN MYSQL EDITOR BEFORE THE PYTHON CODE GIVEN BELOW:
]
source code:
import mysql.connector
con=mysql.connector.connect(host=”localhost”,username=”root”,password=”1234”,d
atabase=”practicalC”)
Q2. Consider the table Designation and write SQL commands for questions (1) to (4). [4]
TABLE : DESIGNATION
mysql>use practicalC;
mysql>create table designation (W_ID INT PRIMARY KEY,SALARY INT,BENEFIT
INT,DESIGNATION VARCHAR(20));
mysql>insert into designation values(102,75000,15000,”MANAGER”);
Write a Python Program to integrate MYSQL with Python for inserting the records given to
Emp table and display the records. [8]
[
QUERIES TO DO IN MYSQL EDITOR BEFORE THE PYTHON CODE GIVEN BELOW:
]
Source Code
import mysql.connector
con=mysql.connector.connect(host=”localhost”,username=”root”,password=”1234”,
database=”practicalD”)
Q2. Consider the following table STUDENT and Write SQL commands for questions (1) to (3)
And Output for (4) and (5) [4]
]
Q2. Consider the table Workers and write SQL commands for questions (1) to (4). [4]
TABLE : WORKERS
mysql>use practicalE;
1. Display product Id, product name, manufacturer for Body wash products.
SELECT
P_ID, PRODUCTNAME,MANUFACTURER FROM PRODUCT
WHERE PRODUCTNAME=”BODY WASH”;
2. To increase the price of Conditioner by 20
UPDATE PRODUCTS SET PRICE=PRICE+20 WHERE PRODUCTNAME=”CONDITIONER”;
3. List the average price of products of each manufacturer.
SELECT MANUFACTURER,AVG(PRICE) FROM PRODUCTS GROUP BY MANUFACTURER;
4. Remove details of product which are manufactured by the manufacturer ORI.
DELETE FROM PRODUCT WHERE MANUFACTURER=”ORI”;
1,RAM,6000
2,ARJUN,7500
3,VARUN,2000
4,ANU,4000
5,RAJI,9000
Result:
Thus, the above python program executed successfully and output is verified.
Q2. Consider the tables Clients and write SQL commands for questions (1) to (4). [4]
TABLE : CLIENTS
C_ID CLIENTNAME CITY P_ID
1 COSMETIC SHOP KOLKATA BW05
6 TOTAL HEALTH MUMBAI MC01
12 LIVE LIFE KOLKATA CO06
15 PRETTY WOMAN KOLKATA BW12
16 DREAMS BANGALORE RP01
[
Queries to execute before the select command:
open idle , create new python file and save that in drive D: or E:
]
Aim:
To Write a Python Program to create a text file book.txt with details of the book and read the
same file and display.
Result:
Thus, the above python program executed successfully and the output is verified.
Q2. Consider the table Designation and write SQL commands for questions (1) to (4). [4]
TABLE : DESIGNATION
mysql>use practicalC;
mysql>create table designation (W_ID INT PRIMARY KEY,SALARY INT,BENEFIT
INT,DESIGNATION VARCHAR(20));
mysql>insert into designation values(102,75000,15000,”MANAGER”);
1. Display product Id, product name, manufacturer for Body wash products.
SELECT
P_ID, PRODUCTNAME,MANUFACTURER FROM PRODUCT
WHERE PRODUCTNAME=”BODY WASH”;
2. To increase the price of Conditioner by 20
UPDATE PRODUCTS SET PRICE=PRICE+20 WHERE PRODUCTNAME=”CONDITIONER”;
3. List the average price of products of each manufacturer.
SELECT MANUFACTURER,AVG(PRICE) FROM PRODUCTS GROUP BY MANUFACTURER;
4. Remove details of product which are manufactured by the manufacturer ORI.
DELETE FROM PRODUCT WHERE MANUFACTURER=”ORI”;