Search This Blog

Tuesday, September 13, 2022

Technical training work:


Task1


Task2:

operators

1.write a C program to print the numbers from n to 0 using for loop.

2.write a C program to print the numbers from n to 0 using while loop.

3.write a C program to print sum of numbers in the given range.

4.write a C program to print even numbers in the given range without using == operator.

5.write a C program to print odd numbers in the given range without using != operator.

6.write a C program to print mathematical table of any given number upto some range.

7.write a C program to print sum of digits in the given number.

8.write a C program to print all the even digits in the given number.

9.write a C program to print sum of the even digits in the given number.

10.write a C program to print difference between sum of even digits  and sum of odd digits in the given number.



Thursday, May 5, 2022

python

def convert(s):
    f = float(s)
    c = (f - 32) * 5/9
    return c

print(convert(78)

Height=float(input("Enter your height in centimeters: "))
Weight=float(input("Enter your Weight in Kg: "))
Height = Height/100
BMI=Weight/(Height*Height)
print("your Body Mass Index is: ",BMI)
if(BMI>0):
	if(BMI<=16):
		print("you are severely underweight")
	elif(BMI<=18.5):
		print("you are underweight")
	elif(BMI<=25):
		print("you are Healthy")
	elif(BMI<=30):
		print("you are overweight")
	else: print("you are severely overweight")
else:("enter valid details")







def check_guess(guess, answer):
    global score
    still_guessing = True
    attempt = 0
    while still_guessing and attempt < 3:
        if guess.lower() == answer.lower():
            print("Correct Answer")
            score = score + 1
            still_guessing = False
        else:
            if attempt < 2:
                guess = input("Sorry Wrong Answer, try again")
            attempt = attempt + 1
    if attempt == 3:
        print("The Correct answer is ",answer )
    
score = 0
print("Guess the Animal")
guess1 = input("Which bear lives at the North Pole? ")
check_guess(guess1, "polar bear")
guess2 = input("Which is the fastest land animal? ")
check_guess(guess2, "Cheetah")
guess3 = input("Which is the larget animal? ")
check_guess(guess3, "Blue Whale")
print("Your Score is "+ str(score))

Thursday, April 7, 2022

dice rolling

 import random

while True:
print(''' 1. roll the dice 2. exit ''')
user = int(input("what you want to do\n"))
if user==1:
number = random.randint(1,6)
print(number)
else:
break

Sunday, January 9, 2022

PL/SQL program

declare

name employee.fname%type;

sa employee.salary%type;

cursor c2 is select fname,salary from employee;

BEGIN

open c2;

update employee set salary=salary+(salary*0.2);

loop

fetch c2 into name,sa;

exit when c2%NOTFOUND;

DBMS_OUTPUT.PUT_LINE(name||'having updated salary is  ' ||sa);

end loop;

END;






declare

emp employee.fname%type;

ss employee.ssn%type:=&ssn;

begin

select fname into emp from employee where ssn=ss;

if sql%notfound then

DBMS_OUTPUT.PUT_LINE('no records found');

else

DBMS_OUTPUT.PUT_LINE('found');

end if;

end;

/













CREATE [OR REPLACE] FUNCTION function_name 

[(parameter_name [IN | OUT | IN OUT] type [, ...])] 

RETURN return_datatype 

{IS | AS} 

BEGIN 

   < function_body > 

END [function_name];





CREATE OR REPLACE FUNCTION sailorscount 

RETURN number IS 

   total number(2) := 0; 

BEGIN 

   SELECT count(*) into total 

   FROM sailors; 

    

   RETURN total; 

END; 

/ 




CREATE OR REPLACE FUNCTION findMax(x IN number, y IN number)  

RETURN number 

IS 

    z number; 

BEGIN 

   IF x > y THEN 

      z:= x; 

   ELSE 

      Z:= y; 

   END IF;  

   RETURN z; 

END; 



DECLARE 

   a number; 

   b number; 

   c number; 

BEGIN 

   a:= &a; 

   b:= &b;  

   c := findMax(a, b); 

   dbms_output.put_line(' Maximum of (a,b): ' || c); 

END; 

/



DECLARE 

   num number; 

   factorial number;  

   

FUNCTION fact(x number) 

RETURN number  

IS 

   f number; 

BEGIN 

   IF x=0 THEN 

      f := 1; 

   ELSE 

      f := x * fact(x-1); 

   END IF; 

RETURN f; 

END;  


BEGIN 

   num:= &num; 

   factorial := fact(num); 

   dbms_output.put_line(' Factorial '|| num || ' is ' || factorial); 

END; 

/





create or replace PROCEDURE findMin(x IN number, y IN number, z OUT number) IS 

BEGIN 

   IF x < y THEN 

      z:= x; 

   ELSE 

      z:= y; 

   END IF; 

END;



DECLARE 

   a number; 

   b number; 

   c number; 

BEGIN 

   a:= 23; 

   b:= 45; 

   findMin(a, b, c); 

   dbms_output.put_line(' Minimum of (23, 45) : ' || c); 

END; 

/




DECLARE 

   a number; 

PROCEDURE squareNum(x IN OUT number) IS 

BEGIN 

  x := x * x; 

END;  

BEGIN 

   a:= 23; 

   squareNum(a); 

   dbms_output.put_line(' Square of (23): ' || a); 

END; 

/




CREATE [OR REPLACE] PROCEDURE procedure_name 

[(parameter_name [IN | OUT | IN OUT] type [, ...])] 

{IS | AS} 

BEGIN 

  < procedure_body > 

END procedure_name;




CREATE OR REPLACE PROCEDURE greetings 

AS 

BEGIN 

   dbms_output.put_line('Hello World!'); 

END; 

/


EXECUTE greetings;


Drop procedure procedurename;






The CASE statement goes through conditions and returns a value when the first condition is met (like an if-then-else statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause.


If there is no ELSE part and no conditions are true, it returns NULL.


CASE Syntax

CASE

    WHEN condition1 THEN result1

    WHEN condition2 THEN result2

    WHEN conditionN THEN resultN

    ELSE result

END;




DECLARE 

   grade char(1) := 'A'; 

BEGIN 

   CASE grade 

      when 'A' then dbms_output.put_line('Excellent'); 

      when 'B' then dbms_output.put_line('Very good'); 

      when 'C' then dbms_output.put_line('Well done'); 

      when 'D' then dbms_output.put_line('You passed'); 

      when 'F' then dbms_output.put_line('Better try again'); 

      else dbms_output.put_line('No such grade'); 

   END CASE; 

END; 

/





DECLARE 

   grade char(1) := 'B'; 

BEGIN 

   case  

      when grade = 'A' then dbms_output.put_line('Excellent'); 

      when grade = 'B' then dbms_output.put_line('Very good'); 

      when grade = 'C' then dbms_output.put_line('Well done'); 

      when grade = 'D' then dbms_output.put_line('You passed'); 

      when grade = 'F' then dbms_output.put_line('Better try again'); 

      else dbms_output.put_line('No such grade'); 

   end case; 

END; 

/



 




Write a PL/SQL program for generating Fibonacci series

declare

a number;

b number;

c number;

n number;

i number;

begin

n:=&n;

a:=0;

b:=1;

dbms_output.put_line(a);

dbms_output.put_line(b);

for i in 1..n-2

loop

c:=a+b;

dbms_output.put_line(c);

a:=b;

b:=c;

end loop;

end;

Wednesday, November 10, 2021

R20 DBMS course Content

 

click here to download  Database System Concepts 7th edition 

click here to download Database Systems - Design, Implementation, and Management (9th Edition)


SEM papers:

R17-DBMS SUPPLY - EXAM DATE 25-10-2021

R17 -DBMS REGULAR - 09-04-2021

R17-DBMS-REGULAR-13-11-2019

R17-DBMS-REGULAR-06-05-2019

R14-DBMS SUPPLY 10-05-2019


UNIT- I

Introduction: An overview of Database Management System

Data Modelling using the Entity Relationship Model

Database Systems - Design, Implementation, and Management (9th Edition)-34-58

Database-System-Concepts-7th-Edition-30-63


DESCRIPTIVE QUESTIONS -I

ASSIGNMENT  (LAST DATE FOR SUBMISSION IS (02-12-2021)

QUIZ QUESTIONS - I

UNIT - I PPT

University Database Case Study for ER diagram:

Movie Data Base Case Study  for ER diagram

UNIT- II


Relational Data Model and Language

Introduction to SQL

Types of Joins

SQL joins

Relational Algebra


DESCRIPTIVE QUESTIONS -II

QUIZ QUESTIONS - II


UNIT- III

Database Systems - Design, Implementation, and Management (9th Edition)[204-246]

Normalization Notes

Normalization PPT

Transaction Management and Concurrency Control


DESCRIPTIVE QUESTIONS -III

QUIZ QUESTIONS - III


UNIT- IV

TRANSACTION ppt

TRANSACTION CONFLICTS/ANOMALIES ppt

CONCURENCY CONTROL ppt 

Database Systems - Design, Implementation, and Management (9th Edition)-444-474

DESCRIPTIVE QUESTIONS -IV

QUIZ QUESTIONS - IV



UNIT- V

Indexing

LEVELS OF RAID

RAID

 Hashing notes

Hashing ppt

Storage 

PROFESSIONAL NO SQL 


DESCRIPTIVE QUESTIONS -V

QUIZ QUESTIONS - V


Sunday, February 23, 2020

Lucky Gifts
 
"Planet Kids Entertainment Fair" is back to delight kids and parents. The Fair will have non-stop entertainment with an extravaganza of games, exciting rides, sports, art & crafts, role-plays, inspiring competitions, prizes & gifts, and yummy food.
 
Few lucky attendees at the Fair will be given a pack of candies as a lucky gift and the show coordinator has assigned you the task for choosing the number of attendees who will receive the pack of candies. There are 'N' candies available and you need to decide how many candies to place in each pack. Each pack must contain the same number of candies. You should choose an integer A between 1 and N, inclusive, and place exactly A candies into each pack. You should make as many packs as possible but since you enjoy eating candies very much, you eat the remaining candies. 
 
Write a program that will calculate the pack size(A) so that you can eat as many candies as possible. If multiple pack size will result in the same number of leftover candies, then print the largest pack size.
 
Input Format:
The first and only line of input contains an integer N.
 
Output Format:
Output a single line that gives the pack size that will maximize the number of leftover candies.
Refer sample input and output for formatting specifications.

Sample Input 1:
2

Sample Output 1:
2

Explanation:
There will be no leftover candies regardless of the size of the pack you choose. So you choose the largest possible pack size 2.

Sample Input 2:
5

Sample Output 2:
3

Explanation:
There will be 2 leftover candies, if you choose 3 as the pack size.









Pranav and Change
 
Pranav, an enthusiastic kid visited the "Fun Fair 2017" along with his family. His father wanted him to purchase entry tickets from the counter for his family members. Being a little kid, he is just learning to understand about units of money. Pranav has paid some amount of money for the tickets but he wants your help to give him back the change of Rs. N using minimum number of rupee notes.
 
Consider a currency system in which there are notes of seven denominations, namely, Rs. 1, Rs. 2, Rs. 5, Rs. 10, Rs. 50, Rs. 100. If the change given to Pranav Rs. N is input, write a program to computer smallest number of notes that will combine to give Rs. N.

Note:
Refer to problem specifications.

Input Format:
First line of the input is an integer N, the change to be given to Pranav.
 
Output Format:
Output should display the the smallest number of notes that will combine to give N.
Refer sample input and output for formatting specifications.

Sample Input 1:
1200

Sample Output1:
12

Sample Input 2:
242

Sample Output2:
7


Problem Requirements:

C

KeywordMin CountMax Count
do00
KeywordMin CountMax Count
while ....00





Tile Game
 

In connection to the National Mathematics Day celebration, the Regional Mathematical Scholars Society had arranged for a Mathematics Challenge Event where school kids participated in large number. Many interesting math games were conducted, one such game that attracted most kids was the tile game where the kids were given 'n' square tiles of the same size and were asked to form the largest possible square using those tiles.
 
Help the kids by writing a program to find the area of the largest possible square that can be formed, given the side of a square tile (in cms) and the number of square tiles available.
 
Input Format:
First line of the input is an integer that corresponds to the side of a square tile (in cms).
Second line of the input is an integer that corresponds to the number of square tiles available.
 
Output Format:
Output should display the area of the largest possible square that can be formed (in square cms) with the available tiles.
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and rest corresponds to output.]

Sample Input and Output :
Enter the side in cm of a square tile
5
Enter the number of square tiles available
8
Area of the largest possible square is 100sqcm


link

 https://wayground.com/join?gc=966822