Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

CBSE 2024 COMPUTER SCIENCE (083)

MARKING SCHEME (SET A)


1. # Program to count and and my
cand = 0
cmy = 0

f = open("study.txt", "w")
str = input("Enter any string : ")
f.write(str)
print("File successfully Created")
f.close( )

f2 = open("study.txt", "r")
D1 = f2.read()
word = str.split()
for x in word:
if(x.lower() == 'and'):
cand = cand + 1
if(x.lower() == 'my'):
cmy = cmy + 1

print("and occurred ",cand," times")


print("my occurred ",cmy," times")
f2.close( )

2. MYSQL
MYSQL> create table employee(ecode int(4),
ename varchar(12), .
salary int(5),
zone varchar(8),
age int(2),
Grade varchar(6),
dept int(2));

MYSQL>Create table department(dept int(2),


dname varchar(12),
entitlement varchar(6));

MYSQL> insert into employee values(101,'Mukul', 30000, 'West', 28, 'A', 11);
MYSQL> insert into employee values(102,'Kritika', 35000, 'Centre', 51, 'A', 22);
MYSQL> insert into employee values(103,'Naveen', 32000, 'East', 40, NULL, 11);
MYSQL> insert into employee values(105,'Uday', 38000, 'North', 38, 'C', 33);
MYSQL> insert into employee values(107,'Nupur', 32000, 'East', 26, NULL, 11);

mysql> insert into department values(11, 'Sales', 'Taxi');


mysql> insert into department values(22, 'Store', 'Air');
mysql> insert into department values(33, 'Finance', 'Car');

1. mysql> select * from employee where salary < 33000;


2. mysql> select sum(salary) from employee where grade = "B";
3. mysql> select ename, age, zone from employee where zone = "East" order by age;
4. mysql> select ecode, ename, dname from employee e, department d where e.dept = d.dept;
CBSE 2024 COMPUTER SCIENCE (083)
MARKING SCHEME (SET B)
1. # Stack - PUSH Employee
employee = [ ]
def push_emp():
employee = [('101', 'Kamal'), ('102', 'Rajesh'),('103','kush')]
print("Original Stack\n",employee)

empid = input("Enter employee id : ")


ename = input("Enter employee name : ")
emp = (empid, ename)
employee.append(emp)
print("Employee successfully added to stack")
print()

print("Stack after adding employee")


x = len(employee)
while(x>0):
print(employee[x-1])
x = x -1

push_emp()

2. MYSQL
MYSQL> create table student(Enrol int(4),
sname varchar(12), .
fee int(5),
House varchar(8),
Class int(2),
Grade varchar(6),
Scode int(2));

MYSQL>Create table Stream(scode int(2),


sname varchar(12),
Chapters varchar(6));

MYSQL> insert into student values(101,'Nanda', 5000, 'Green', 11, 'A', 'S11');
MYSQL> insert into student values(102,'Saurabh', 3000, 'Blue', 12, 'B', 'S33');
MYSQL> insert into student values(103,'Kamal', 3000, 'Green', 12, NULL, 'S33');
MYSQL> insert into student values(105,'Praveen', 25000, 'Red', 11, 'C', 'S11');
MYSQL> insert into student values(107,'Arvind', 4500, 'Blue', 12, NULL, S22');

mysql> insert into stream values('S11', 'Science', 15);


mysql> insert into stream values('S22', 'Commerce', 11);
mysql> insert into stream values('S33', 'Humanities', 12);

1. mysql> select * from Student where fee < 3000;


2. mysql> select sum(fee) from student where class = 11;
3. mysql> select sname, class, fee, house from student where House = "Blue" order by fee;
4. mysql> select Enrol, sname, scode from student s, stream t where s.scode = e.scode;
CBSE 2024 COMPUTER SCIENCE (083)
MARKING SCHEME (SET C)
1. # Stack - PUSH Employee
#Stack - POP Employee (Delete employee)
employee = [ ]
def pop_emp():
employee = [('101', 'Kamal'), ('102', 'Rajesh'),('103','kush')]
print("Original Stack\n",employee)

if(employee == []):
print("No employee Exists - Empty Stack")
else:
empid, ename = employee.pop()
print("Deleted items : ",empid, ename)
print()

print("Employee after deletion")


x = len(employee)
while(x>0):
print(employee[x-1])
x = x -1

pop_emp()

2. MYSQL
MYSQL> create table student(Enrol int(4),
sname varchar(12), .
fee int(5),
House varchar(8),
Class int(2),
Grade varchar(6),
Scode int(2));

MYSQL>Create table Stream(scode int(2),


sname varchar(12),
Chapters varchar(6));

MYSQL> insert into student values(101,'Nanda', 5000, 'Green', 11, 'A', 'S11');
MYSQL> insert into student values(102,'Saurabh', 3000, 'Blue', 12, 'B', 'S33');
MYSQL> insert into student values(103,'Kamal', 3000, 'Green', 12, NULL, 'S33');
MYSQL> insert into student values(105,'Praveen', 25000, 'Red', 11, 'C', 'S11');
MYSQL> insert into student values(107,'Arvind', 4500, 'Green', 12, NULL, S22');

mysql> insert into stream values('S11', 'Science', 15);


mysql> insert into stream values('S22', 'Commerce', 11);
mysql> insert into stream values('S33', 'Humanities', 12);

1. mysql> select * from Student where fee > 3000;


2. mysql> select sum(fee) from student where class = 12;
3. mysql> select sname, class, fee, house from student where House = "Green" order by fee;
4. mysql> select Enrol, sname, scode from student s, stream t where s.scode = e.scode;

You might also like