Thursday 24 November 2022

NEP PDP MCQs

 Q1) By which year the target of 50% GER in Higher Education has to be achieved?

Ans: 2035
Q2) Which one of the following is not required by the institutional mechanisms to oversee that campus is inclusive in its practice? 
Ans: ICC
Q3) NEP-2020 states that learning should be
Ans: experiential
Q4) According to which Upanishad 'Atman' is same in all the creatures of the world
Ans: Brihdaranyakopanishad 
Q5) What is the guiding light of the National Education Policy-2020?
Ans: Rich heritage of ancient and traditional Indian knowledge
Q6) Name the ancient institution which is not mentioned in NEP-2020
Ans: ViswaBharati  
Takshashila, Nalanda,Vikramshila, Vallabhi
Q7) full form of ABC as per the NEP-2020
Ans: Academic bank of credits
Q8) Student Information System does not involve student’s information during the following stage
Ans: pre enrollment
Q9) NEP-2020 emphasises on adoption of new technology with focus on
Ans: how the students learn
Q10) What does SWAYAM stands for
Ans: Study Webs of Active of active learning of young aspiring minds
Q11) SAMARTH Platform is used for
Ans: Organization and management
Q12) Which one of the following is not an aspect of Internationalization of Education
Ans:Promoting local languages 
Q13) What does quality higher education with reference to NEP-2020 aim for? 
Ans: Developing creative individuals
Q14)  Which one of the following is the features of quality academic research?
Ans: Addressing needs of society
Q15) Which one of the following is not the emphasis of NEP-2020? 
Ans: Rigid separation of disciplines 
Q 16) National Research Foundation will not focus on? 
Requirements of industries and social institutions 
Q17) Which one of the following is not a regulatory body of Higher Education Institutions? 
Ans: CSIR
Q18) The teacher’s assessment technique with reference to NEP-2020 should:
Ans: Move from summative assessment to formative assessment
Q19) While designing curriculum, an educational institution includes internship as an instructional component. This is a step towards
Ans: Learner Centered approach
Q 20) If a teacher discourages question-answer in the classroom, the teacher is 
Ans: Not implementing the NEP’s expectations
Q21) The Board of Governors of higher education institution should not include distinguished members from the following community:
Ans: persons with criminal

Q22) The practice of sharing information with stakeholders using the institution’s website 
Ans: Enhances accountability and transparency in governance 
Q23) What is the objective of National Assessment Centre, PARAKH?
Ans: setting standards
Q25) NEP-2020 recommends that regions of the country with large populations from Socially Educationally Disadvantaged Groups (SEDGs) should be declared as:
Ans: Special Education Zones SEZs
Q24) What is the single biggest tool for achieving social justice and equality according to NEP-2020
Ans: holistic education
Q26) Liberal education as per NEP-2020 is identical to:
Ans: Holistic and multidisciplinary education
Q27) Holistic education does not refer to the development of: 
Ans: Recalling 
Q 28) Liberal education does not allow students to: 
Ans: discourage collaboration
Q29) What is the fourth vertical of HECI?
Ans: GEC

Q35) 
By which year, the minimum degree qualification for teaching is going to be a 4-year integrated B.Ed. degree?
Ans: 2030
Q34) Full form of NCTE
Ans: National Council for Teacher Education
Q32) government initiative for leadership development in education
Ans: LEAP (Leadership for Academicians Programme).
Q31) What shall be the functions of HEGC:
Ans: Regulating HEIs

Q) Which one of the following is not a Higher Order Thinking Skill?
Ans: understanding
Q) The curriculum framework for adult education related to vocational skills development programme would focus on one of the following outcomes:
Ans: obtaining degrees
Q)The proposed autonomous body that would provide a platform for exchange of ideas on use of technology to enhance learning
Ans: NETF
Q)Which of the following organization as per NEP-2020 should undertake pilot studies for online education?
Ans: NIT
Q) Higher Education Commission of India (HECI) will have how many verticals? 
Ans: 4
Q) The Global Education Development agenda in the Sustainable Development Goals (SDGs) is reflected in
Ans: SDG4
Q)NEP-2020 proposed a new National Assessment Centre to be named as
Ans: PARAKH
Q)The fourth vertical of HECI is
Ans: GEC
Q) Gross Enrolment Ratio in higher education in the year 2019-20 was
Ans: 27.1%
Q) The National Curriculum Framework for 2020-21 will be based on the principles of
Ans: NEP 2020
Q) Under the 'Ek Bharat Samarth Bharat' scheme in NEP-2020, students will be sent to how many tourist destinations?
Ans: 100
Q) NEP-2020 proposes the use of mother tongue or local language as medium of instruction primarily upto
Ans: Grade 5
Q) Virtual labs for students would be created on which of the following e-learning platforms
Ans: DIKSHA
Q)Which of the following is not a professional standard setting body
Ans: The professional councils, such as the Indian Council for Agricultural Research (ICAR), Veterinary Council of India (VCI), National Council for Teacher Education (NCTE), Council of Architecture (CoA), National Council for Vocational Education and Training (NCVET), will act as Professional Standard Setting Bodies (PSSBs).
Q)The first National Policy on Education came in the year
Ans: 1968

Friday 14 October 2022

Teaching and Research aptitude questions

aptitude is  capacity for learning certain abilities
it also refers to potential capacity in some narrow area
analytical research uses already available research
empirical research involves observation of fact or interaction with people
the main reason for following rigorous research methods is to reduce errors in drawing conclusions

Semantic barriers is an obstruction caused in the process of receiving or 
understanding a message during the process of encoding or decoding
into words and ideas 

in linear model, receiver passively receives the message and acts as directed
or desired by sender

hetvabhasa appears valid but is not known
a method of assumption of an unknown fact
to account for a known fact
i.e, otherwise, inexplicable is arthapatti pramana
upamana is comparison or resemblance as a source of correct knowledge 
Think about their thinking is meta cognition

line chart is used to display continuous data and used for predicting future
sales data of a company month over month is displayed by line chart

distinguishing correct from incorrect argument is logic

hypothesis testing is an example of inductive reasoning
research questions here must be confirmatory

quantitative methods are useful for both precise description and comparison

the extent to which measures of construct of interest
are uncorrelated or weakly correlated
with measures of unrelated constructs is known as
discriminant validity


video links
https://www.youtube.com/watch?v=2vPOLLfy1Y8

https://www.youtube.com/watch?v=jc2GWJBN3vM&t=2188s

https://www.youtube.com/watch?v=V0czbhn2Vm8



Thursday 21 July 2022

MCQs on Web Technologies

 The term byte stuf fing refers to 


Data stuffing used wi th character oriented

hardware

Data stuffing used wi th bi t oriented hardware

Data stuffing used with both A and B

Data stuffing used wi th byte oriented hardware


      _____________________________________________________________________________________

What does the URL need to access documents ?

I. Path name

II. Host name

III. DNS

IV. Retrieval method

V. Server port number 


I, II, III

I, III, V

I, II, IV

III, IV, V

      _____________________________________________________________________________________

The most popular way to materialize XML document is to use 


DTD

XSLT

HTML

SOAP

      _____________________________________________________________________________________

Output of XML document can be viewed as 


Word processor

Web browser

Notepad

None of the

above

      _____________________________________________________________________________________

XML 


Can be used as a database

Cannot be used as a database

XML is not a database ,it is

language

None of these

      _____________________________________________________________________________________

What is so great about XML? 


Easy data exchange

High speed on

network

Both A and B

None of the above

      _____________________________________________________________________________________

Let most segment of a name inn DNS represents 


Individual

Network


Individual

computer

Domain name

Network type

      _____________________________________________________________________________________

How many root element can an XML document have ? 

One

Two

Three

As many as the memory

provides

      _____________________________________________________________________________________

The tags in XML are 


Case insensitive

Case sensitive

Browser

dependent

None of these

      _____________________________________________________________________________________

Which of the following attributes below are used for a font name? 


Fontnam

e

fn

Font

Face

      _____________________________________________________________________________________

Which of the following statement is true? 


An XML document can have one root

element.

An XML document can have one child

element.

XML elements have to be in lower case.

All of the above.

      _____________________________________________________________________________________

Which of the following statement is true? 


All the statements are true.

All XML elements must have closing

tag.

All XML elements must be lower

case.

All XML documents must have a

DTD.


      _____________________________________________________________________________________

CIDR stands for 


Classified Internet Domain

Routing


Classless Inter Domain Routing

Classless Internet Domain

Routing

Classified Inter Domain Routing


      _____________________________________________________________________________________

Which of the following protocol is not used in the internet? 


Telnet

WIRL

HTTP

Goph

er

      _____________________________________________________________________________________

The XML DOM object is 


Entity

Entity reference

Comment

reference

Comment data

      _____________________________________________________________________________________

Attributes in XML are 

Elements inXML

Child nodes

A way of attaching characteristics or properties to elements of a

document

None of these

      _____________________________________________________________________________________

XML uses the features of 


HTML

XHTML

VML

SGML

      _____________________________________________________________________________________

What are empty elements and is it valid? 


No there is no such terms as empty

element

Empty elements are element with no

data

No it is not valid to use empty element

None of these

      _____________________________________________________________________________________

Well formed XML document means 

It contains a root element

It contain an element

It contains one or more elements

Must contain one or more elements and root element must contain all other


elements

      _____________________________________________________________________________________

A header in CGI script can specify 


Format of the document

New locat ion of the

document

A and B both

Start of the document

      _____________________________________________________________________________________

In HTML URI is used to 


Create a frame document

Create a image map in the webpage

Customize the image in the webpage

Identify a name or a resource on the

internet


      _____________________________________________________________________________________

The MIME text file is saved with 


HMT extension

HTML

extension

THM extension

None of these

      _____________________________________________________________________________________

Namespace 


Distinguishes one XML vocabulary from

another

Provides the spaces in the names

Is a querying language

None of these

      _____________________________________________________________________________________

Microsoft XML schema data types for hexadecimal digits representing octates 


UID

UXID

UUID

XXID

      _____________________________________________________________________________________

XML DSOs has the property for the number of pages of data the recordset contains 

Count

Number

Pagecount

Pagenumb

er

      _____________________________________________________________________________________

Which type of web document is run at the client site 


Static


Dynamic

Active

All of the

above

      _____________________________________________________________________________________

FDDI (Fiber Distributed Data Interconnect) is an example of 


Token ring

Token bus

Star topology

Multipoint

network

      _____________________________________________________________________________________

Hardware that calculates CRC uses 


Shift register

Xor unit

Both A and B

Instruction

register

      _____________________________________________________________________________________

DOM is a 


A parser

Specificatio

n

Coding style

None of

these

      _____________________________________________________________________________________

MSXML is 


A Microsoft language

XML parser that ships with

IE5.0

Used for interacting with XML

None of these

      _____________________________________________________________________________________

Each list item in an ordered or unordered list has which tag? 


List

tag

Is tag

Li tag

Ol tag

      _____________________________________________________________________________________

What is XML? 


Subset of SGML,Extensible Markup

Language

Superset of SGML,Extensible Markup

Language


Like SGML ,Extended Markup Language

None of these

      _____________________________________________________________________________________

www is based on which model? 


Local server

Client

server

3 tier

None of

these

      _____________________________________________________________________________________

XML is a 


Imperative

language

Declarative

language

Standard

None of these

      _____________________________________________________________________________________

What is the use of web font in HTML? 


That is the core font that is used to develop web pages

That enables to use fonts over the web without installation

That is the special font that is developed by Microsoft

corporation

All of the above


      _____________________________________________________________________________________

Which of the following tags below are used for multi line text input control? 


Textml tag

Text tag

Textarea

tag

Both a and

b

      _____________________________________________________________________________________

Which tags are commonly used by search engines? 


Headings

Title

Paragrap

h

All of

these

      _____________________________________________________________________________________

The HTML tags are enclosed within 


Curly braces

Parentheses

Angle


brackets

Square

brackets

      _____________________________________________________________________________________

BCC in the internet refers to 


Black carbon copy

Blind carbon copy

Blank carbon copy

Beautiful carbon

copy

      _____________________________________________________________________________________

All exceptions in Java are subclasses of built in class called 


Exceptio

n

Error

Throwabl

e

Raise

      _____________________________________________________________________________________

Which Layer is not present in TCP/ IP model? 


Application

Layer

Internet Layer

Transport Layer

Presentation

Layer

      _____________________________________________________________________________________

Which of the following identifies a specific web page and its computer on the Web? 


Web site

Web site

address

URL

Domain Name

      _____________________________________________________________________________________

Node in XML is 


Any part of the document whether it is elements ,attributes or

otherwise

Referred only to the attributes

Referred to the top element in the document

None of these


      _____________________________________________________________________________________

XML document can be viewed in 


IE 3.0

IE 2.0

IE 6.0

IE


X.0

      _____________________________________________________________________________________

DMSP stands for 


Distributed Mail System Protocol

Distributed Message System

Protocol

Distributed Message System Pool

Distributed Mail System Pool


      _____________________________________________________________________________________

The main function of a browser is to 


Compile HTML

Interpret HTML

De-compile HTML

Interpret CGI

programs

      _____________________________________________________________________________________

Characteristic encoding is 


Method used to represent numbers in a

character

Method used to represent character in a

number

Not a method

None of these

      _____________________________________________________________________________________

The web standard allows programmers on many different computer platforms to dispersed format and display the information server.These programs are called 


Web browsers

HTML

Internet

Explorer

None of these

      _____________________________________________________________________________________

XPATH used to 


Address your documents by specifying a location

path

Address the server

Store the IP of the server

None of these


      _____________________________________________________________________________________

Unl ike Ipv4, Ipv6 does not include the following field in the base header 


Next Header field

Field for Fragmentation

information

Flow Label

Kind field

Introduction to data science using R in telugu

what is dbms?

normalization in dbms in telugu

Tuesday 19 April 2022

science and technology degree college lecturers

https://www.youtube.com/watch?v=-B0dvYhxEKA&list=PLYBH3ftUv0JjdXTLhmDV8zpNsJo9YVeHV
German: Karl Ereky; October 20, 1878 – June 17, 1952) was a Hungarian agricultural engineer. The term 'biotechnology' was coined by him in 1919.
https://www.youtube.com/watch?v=gAE1dcSP5nc&list=PLKjIt9ww02WPnZF0p5p701vp7ELWCcL50&index=2

Genetic engineering, also called genetic modification or genetic manipulation, is the direct manipulation of an organism's genes using biotechnology. It is a set of technologies used to change the genetic makeup of cells, including the transfer of genes within and across species boundaries to produce improved or novel organisms. New DNA is obtained by either isolating and copying the genetic material of interest using recombinant DNA methods or by artificially synthesising the DNA. A construct is usually created and used to insert this DNA into the host organism. The first recombinant DNA molecule was made by Paul Berg in 1972 by combining DNA from the monkey virus SV40 with the lambda virus. As well as inserting genes, the process can be used to remove, or "knock out", genes. The new DNA can be inserted randomly, or targeted to a specific part of the genome.




genetic engineering uses ecoli bacteria
E. coli (Escherichia coli), is a type of bacteria that normally lives in your intestines. It’s also found in the gut of some animals.

Most types of E. coli are harmless and even help keep your digestive tract healthy.

genetic engineering uses rDNA technology, DNA fingerprinting,paper or Gel electrophoresis, chromatography
Recombinant DNA (rDNA) molecules are DNA molecules formed by laboratory methods of genetic recombination (such as molecular cloning) to bring together genetic material from multiple sources, creating sequences that would not otherwise be found in the genome.

DNA fingerprinting is a method used to identify an individual from a sample of DNA by looking at unique patterns in their DNA.

paper or Gel electrophoresis is a laboratory method used to separate mixtures of DNA, RNA, or proteins according to molecular size using electricity

chromatography is the term describing all forms of chemical seperations that involve moving the analyte mixture through a column or over a stationary phase. As the plug of analytes moves down the column physical and/or chemical difference between analytes cause them to move at different rates, seperating them by the end of the column
https://www.youtube.com/watch?v=KeKNrzmS8gw

genetic engineering created following enzymes
1. renate is used to create artificial junnu
2. protiase: to make flesh smooth
3. popain: toilet cleaning
4. mono podium gluta mate: to give taste to edible foods

genetic engineering created following hormone
emulin : for diabetic patients

genetic engineering created following interferons( artificial protien to fight against virus)
alpha interferons

antibiotic
1. pencilin -alexander fleming

vaccines
edward jenner: first vaccines for small pox

mono clonal antibodies --same structure, same size and ..for treating of cancer

https://www.youtube.com/watch?v=2kDQ4OC0fHk&list=PLExtjHrmS9TsnDliiCpM2LBlk92g_AJzW
enzyme: en means in and zyme means yeast.
enzyme was first found in yeast.
enzymes will increase the chemical reaction with less activation energy(ATP is energy rich molecule)
enzymes can work with acids and alkalines
two types of enzymes -1. inactive (end with gen) 2. active (end with ase)
simple enzymes are made up of protiens and complex enzymes are made up of protien and non protiens

protiens are organic compounds that consists of carbon, hydrogen, oxygen, nitrogen, phosphorus and sulphur
protiens are found in hair, nails, skin, animal fur and feathers
protien consisting foods are pulses, milk, egg and meat.
protiens are made up of amino acids bonded using peptide bond
insulin is a protien  where amino acids are connected in linear
myoglobin protien where amino acids are connected in helical manner
tertiary structure where amino acids are connected in 3D form
Quaternary structure : tertiary structure combined together ex: haemoglobin
Uses of protien:
hormones are made up of protien
used in defense (antibodies)
used in transport ex:
help in blood clotting

nitogenous bases are
1. adenine
2. guaninge
3. cytocine
these above three are present in DNA/ RNA
4. thymine present in DNA
5.uracil present in RNA
 nucleic acid is made up of nucleotides
nucleotides are made up of nucleosides and phosphoric acid
nucleoside is made up of nitrogenous base and phosphate sugar.

mononucleotide: ex : ATP gives 31.81 kj or 7.3 kcal/mol when ATP is converted to ADP
polynucleotide: formed by many nucleotide ex: DNA and RNA

Lipids (kovvulu) organic compound that does not dissolve in water
lipid is present in fruits, nuts and oils
organic compounds dissolve in organic solvents
inorganic solvents : water
classification of lipids
1. acyl glycerol
         a) saturated : found in animal , double bond between carbon and carbon ex: icecream, butter
         b) unsaturated : found in plants , triple bond between carbon and carbon ex: oils, olive oils....
2. waxes : found in protective layer ex: petals, sepals, animal fur,
3. Phospho lipids: glycerol + 2 fatty acids +1 phosphoric acid
associated with cell membrane --has two heads--a) hydro philic : water loving/attract b) hydro phobic: water fearing
4. terpenoids
a) caretinoids : produce colour
b) steroids : four ring carbon strucutre ex: cholosterol is made up of  steroids
c) tarpene : produce smell used in perfumes

carbohydrates: carbon+water
types of carbohydrates
1. mono saccharides : 
        a) glucose : found in fruits
        b) fructose : found in honey
        c) galactose : found in milk
2. di saccharides :
   a) glucose + glucose : maltose found in burger, pizza and chocolates
   b) glucose + fructose :  sucrose found in sugarcane and fruits
   c) glucose + galactose : Lactose found in milk

3. oilgo saccharides : 2 to 10 sugar molecules
4. poly saccharides : > 10 sugar molecules
      insoluble in water
         a) starch : reserve food in plants stored in beans, leaves, roots
         b) edible starch or glycogen : reserve food in humans/ animals stored in liver, muscles
         c) cellulose : used in boundary of cells


Greedy problem

Find smallest number with given number of digits and sum of digits


#include<stdio.h>

int main() {
   int sum,d;
   scanf("%d%d",&sum,&d);
   if(sum == 0)
   {
       if(d == 1)
            printf("0");
       else
            printf("Not Possible");
   }
   else if(sum > 9*d)
            printf("Not Possible");  
   else
   {
        int ans[d],i;
        sum = sum-1;
        for(i=d-1;i>0;i--)
        {
            if(sum>9)
            {
                ans[i]=9;
                sum = sum -9;
            }
            else
            {
                ans[i] = sum;
                sum=0;
            }
        }
        ans[0]=sum+1;
        for(i=0;i<d;i++)
            printf("%d",ans[i]);
   }
}

Bit wise operators Questions in C

Bitwise And

  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n;
  5. printf("Enter an integer\n");
  6. scanf("%d",&n);
  7. if ( n & 1 == 1 )
  8. printf("Odd\n");
  9. else
  10. printf("Even\n");
  11. return 0;
  12. }

Bitwise XOR 

Symbol used is ^

#include <stdio.h>
main()
{
 int x=1,y=3;
 if(x ^ y)
  printf("x is not equal to y");
 else
  printf("x is equal to y");
}

Practice Problem

https://www.codechef.com/problems/MISSP

Chef is fan of pairs and he likes all things that come in pairs. He even has a doll collection in which all dolls have paired.One day while going through his collection he found that there are odd number of dolls. Someone had stolen a doll!!!
Help chef find which type of doll is missing..

#include <stdio.h>
   
    int main()
{
        int t, n, m, b;
       
           
        scanf ("%d\n", &t);
        while (t--)
{
            b = 0;
           
            scanf("%d\n", &n);
           
            while (n--)
{
                scanf("%d\n", &m);
                b ^= m;
            }
           
            printf("%d\n", b);
        }
       
        return 0;
    }

Bitwise <<


Arithmetic, assignment,logical operator question in c

Questions on Arithmetic operators
1. A computer programming contest requires teams of 5 members each.
Write a program that asks for the number of players and then give 
the number of teams and number of players leftover?

2. Find the number of months and leftover when the number of days
are given (assume each month has only 30 days)

3. https://www.hackerrank.com/challenges/combo-meal/submissions/code/112740245

4. Number of questions on modulus operator can be explained
Questions on Assignment operator
Explanation: different types of assignments  a =10, a =b, a= b+c

1. Swap two variables
Questions on Logical Operators

// Input an integer number and check whether 
// it is divisible by 9 or 7.

#include <stdio.h>

int main()
{
    int num;
    
    //input number
    printf("Enter an integer number: ");
    scanf("%d", &num);
    
    //check the condition
    if(num%9==0 || num%7==0)
        printf("%d is divisible by 9 or 7\n",num);
    else
        printf("%d is not divisible by 9 or 7\n",num);
        
    return 0;
}
// Input gender in single character and print full gender
// (Ex: if input is 'M' or 'm' - it should print "Male").

#include <stdio.h>

int main()
{
    char gender;
    
    //input gender
    printf("Enter gender (m/M/f/F): ");
    scanf("%c", &gender);
    
    //check the condition and print gender
    if(gender=='m' || gender=='M')
        printf("Gender is Male");
    else if(gender=='f' || gender=='F')
        printf("Gender is Female");
    else
        printf("Unspecified gender");
        
    return 0;
}


Tuesday 5 April 2022

Reverse the contents of a file and store in another file using fseek in c

 #include <stdio.h>

#include<stdlib.h>

int main()

{

    FILE *fp1,*fp2;

    fp1=fopen("input.txt","r");

    fp2=fopen("output.txt","w");

    char ch;

    fseek(fp1,-1,SEEK_END);

    while(1)

    {

        ch=fgetc(fp1);

        fputc(ch,fp2);

        if(fseek(fp1,-2,SEEK_CUR) <0) 

        break;

    }

    fclose(fp1);

    fclose(fp2);

    return 0;

}

======(OR) =====

#include <stdio.h>

#include<stdlib.h>

int main()

{

    FILE *fp1,*fp2;

    fp1=fopen("input.txt","r");

    fp2=fopen("output.txt","w");

    char ch;

    int c,i=1;

    fseek(fp1,0,SEEK_END);

    for(c=ftell(fp1);i<=c;i++)

    {

        fseek(fp1,-i,SEEK_END);

        ch=fgetc(fp1);

        fputc(ch,fp2);

    }

    fclose(fp1);

    fclose(fp2);

    return 0;

}


Saturday 12 February 2022

DBMS LAB EXPERIMENTS

 

INDEX

S.No.

Date

Experiment

Page No.

1

 

Create a table employee (empno,empname, address, deptno, salary)

Write the queries for the following

(i)     Display all the records of the employee table

(ii)   Display empno ,empname, and salary of all the employees in the employee table

(iii)  Display all the records of the employees from department number 1.

(iv)  Display the empno and name of all the employees from deptno2

(v)    Display empno,empname ,deptno and salary in the descending order of Salary

(vi)  Display the empno and name of employees whose salary is between 2000 and 5000

(vii)           Change the salary of the employee to 25000 whose salary is 2000

(viii)          Change the address of a particular employee

(ix)  Display the details of all the employee whose name starts with ‘S’.

(x)     Display the details of all the employees whose name ends with ‘a’

2-4

2

 

Create two tables  Student (rollno, sname, dno)

 Department (dno, dname)

With primary key and foreign key relationships and check the integrity constraint.

(i)              Write a query to display the rollno, sname, dno, and dname for all students.

5-6

3

 

Demonstrate ALTER TABLE statement to add, delete, or modify columns in an existing table. (First, create a table ‘Products’ with pid, pname attributes – then, add price and company attributes and work with them)

7-8

4

 

Demonstrate DROP TABLE and TRUNCATE TABLE commands (First, create a table ‘Suppliers’ with sno,sname and location attributes)

9

5

 

Demonstrate the following constraints

(i)       not null

(ii)      unique

(iii)     check

(iv)     default

10-11

6

 

Write SQL queries to demonstrate aggregate functions

12-13

7

 

Write SQL queries to demonstrate set operations

14-15

8

 

Write a PL/SQL programme to find the biggest of two numbers (use ‘if’ )

16

9

 

Write a PL/SQL programme to display all the even numbers between 1 and 20

16

10

 

Write a PL/SQL programme to demonstrate cursors

17-18

11

 

Write a PL/SQL programme to demonstrate procedures.

19-20

12

 

Write a PL/SQL programme to demonstrate functions

21

13

 

Write a PL/SQL programme to demonstrate triggers.

22-23

 

 

Experiment No: 1

create table employee(empno number(2), empname varchar2(10), address varchar2(30), deptno number(2), salary number(6), PRIMARY KEY(empno));

Output:

Table Created.

insert into employee values(01,'Arun','16/a Chittoor',02,2000);

1 row(s) inserted.

insert into employee values(02,'Ravi','12/b Chittoor',01,2500);

1 row(s) inserted.

 

insert into employee values(03,'Asha','18/a Chittoor',02,5000);

1 row(s) inserted.

(i)              Display all the records of the employee table

Select * from employee;

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

1

Arun

16/a Chittoor

2

2000

2

Ravi

12/b Chittoor

1

2500

3

Asha

18/a Chittoor

2

5000

 

(ii)            Display empno ,empname, and salary of all the employees in the employee table

 

select empno,empname,salary from employee;

EMPNO

EMPNAME

SALARY

1

Arun

2000

2

Ravi

2500

3

Asha

5000

 

(iii)            Display all the records of the employees from department number 1.

 

select * from employee where deptno = 01;

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

2

Ravi

12/b Chittoor

1

2500

 

(iv)           Display the empno and name of all the employees from deptno2

 

select empno,empname from employee where deptno = 02;

EMPNO

EMPNAME

1

Arun

3

Asha

 

(v)             Display empno,empname ,deptno and salary in the descending order of Salary

 

select empno,empname,deptno,salary from employee order by salary desc;

EMPNO

EMPNAME

DEPTNO

SALARY

3

Asha

2

5000

2

Ravi

1

2500

1

Arun

2

2000

 

(vi)           Display the empno and name of employees whose salary is between 2000 and 5000

 

select empno,empname from employee where salary between 2000 and 5000;

EMPNO

EMPNAME

1

Arun

2

Ravi

3

Asha

 

(vii)         Change the salary of the employee to 25000 whose salary is 2000

 

update employee set salary = 25000 where salary = 2000;

      1 row(s) updated.

 

Select * from employee;

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

1

Arun

16/a Chittoor

2

25000

2

Ravi

12/b Chittoor

1

2500

3

Asha

18/a Chittoor

2

5000

(viii)       Change the address of a particular employee

 

update employee set address = '15/c Chittoor' where address = '12/b Chittoor';

      1 row(s) updated.

 

Select * from employee;

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

1

Arun

16/a Chittoor

2

25000

2

Ravi

15/c Chittoor

1

2500

3

Asha

18/a Chittoor

2

5000

 

insert into employee values(4,'Shami','11/a Chittoor',1,34000);
 
        1 row(s) inserted.

 

      Select * from employee;

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

1

Arun

16/a Chittoor

2

25000

2

Ravi

15/c Chittoor

1

2500

3

Asha

18/a Chittoor

2

5000

4

Shami

11/a Chittoor

1

34000

(ix)             Display the details of all the employee whose name starts with ‘S’.

 
        select * from employee where empname like 'S%';

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

4

Shami

11/a Chittoor

1

34000

 

(x)             Display the details of all the employees whose name ends with ‘a’

      
      select * from employee where empname like '%a';

 

EMPNO

EMPNAME

ADDRESS

DEPTNO

SALARY

3

Asha

18/a Chittoor

2

5000

 

 

 

 


 

Experiment No: 2

Create two tables

 Student (rollno, sname, dno)

 Department (dno, dname)

With primary key and foreign key relationships and check the integrity constraint.

(i)              Write a query to display the rollno, sname, dno, and dname for all students.

 

 

create table department(dno number(2), dname varchar2(20), PRIMARY KEY(dno));
Table created.

 

Insert one by one

insert into department values(1,'MATHS');
insert into department values(2,'English');
insert into department values(3,'Computers');
 
select * from department;
 

DNO

DNAME

1

MATHS

2

English

3

Computers

 

create table student(rollno number(10), sname varchar2(20), dno number(2), 
PRIMARY KEY(rollno), FOREIGN KEY(dno) references department(dno));
 
Table created.

 

Insert one by one

insert into student values(1501,'Hari',1);
insert into student values(1601,'Balu',2);
insert into student values(1701,'Siraj',3);
 
select * from student;

ROLLNO

SNAME

DNO

1501

Hari

1

1601

Balu

2

1701

Siraj

3

 

 

 

insert into student values(1801,'Saini',4);

ORA-02291: integrity constraint (SYSTEM.SYS_C004050) violated - parent key not found

 

(i)              Write a query to display the rollno, sname, dno, and dname for all students.

 

select student.*, department.dname from department, student where 
department.dno = student.dno;

ROLLNO

SNAME

DNO

DNAME

1501

Hari

1

MATHS

1601

Balu

2

English

1701

Siraj

3

Computers

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Experiment No: 3

Demonstrate ALTER TABLE statement to add, delete, or modify columns in an existing table. (First, create a table ‘Products’ with pid, pname attributes – then, add price and company attributes and work with them)

 

Creating Table:

create table products(pid number(2), pname varchar2(20));
Table created.

 

Alter Command to ADD:

alter table products ADD price number(10);
Table altered.

 

Description Command:

desc products;

Table

Column

Data Type

Length

Precision

PRODUCTS

PID

Number

-

2

 

PNAME

Varchar2

20

-

 

PRICE

Number

-

10

1 - 3

 

Alter Command to DROP Column:

alter table products DROP COLUMN price;

Table dropped.

desc products;

 

Table

Column

Data Type

Length

Precision

 

PRODUCTS

PID

Number

-

2

 

 

PNAME

Varchar2

20

-

 

1 - 2

 

Alter Command to modify Column:

 

alter table products modify pid varchar2(10);

Table altered.

 

desc products;

 

Table

Column

Data Type

Length

Precision

PRODUCTS

PID

Varchar2

10

-

 

PNAME

Varchar2

20

-

1 - 2

 

 

 


 

Experiment No: 4

Demonstrate DROP TABLE and TRUNCATE TABLE commands (First, create a table ‘Suppliers’ with sno,sname and location attributes)

 

create table suppliers(sno number(6), sname varchar2(20), location varchar2(30));
Table created.

 

Insert one by one

insert into suppliers values(01,'Dany','Chennai');
insert into suppliers values(02,'Kane','Mumbai');
insert into suppliers values(03,'Rahul','Bangalore');
select * from suppliers;

SNO

SNAME

LOCATION

1

Dany

Chennai

2

Kane

Mumbai

3

Rahul

Bangalore

 

desc suppliers;

Table

Column

Data Type

Length

Precision

SUPPLIERS

SNO

Number

-

6

 

SNAME

Varchar2

20

-

 

LOCATION

Varchar2

30

-

 

truncate table suppliers;
Table truncated.
 
select * from suppliers;

no data found

desc suppliers;

Table

Column

Data Type

Length

Precision

SUPPLIERS

SNO

Number

-

6

 

SNAME

Varchar2

20

-

 

LOCATION

Varchar2

30

-

 

drop table suppliers;
 
Table dropped.
 
select * from suppliers;
 
ORA-00942: table or view does not exist

 

 

Experiment No: 5

Demonstrate the following constraints

1.     not null

2.     unique

3.     check

4.     default

 

Create Table Query:

create table OFFICE(sno number(3) NOT NULL, id number(3) UNIQUE, name varchar2(20), age number CHECK(age>25), branch varchar2(10) DEFAULT 'CS');

Table created.
 
insert into OFFICE values(1,101,'Siraj',26,'IT');


1 row(s) inserted.
 

 

(1)   NOT NULL

 
insert into OFFICE values(NULL,102,'Saran',26,'IT');

 

ORA-01400: cannot insert NULL into ("SYSTEM"."OFFICE"."SNO")

 

(2)   UNIQUE

insert into OFFICE values(02,102,'Saran',26,'IT');

 

1 row(s) inserted.
 

insert into OFFICE values(03,102,'Samad',28,'IT');

 

ORA-00001: unique constraint (SYSTEM.SYS_C004053) violated

 

select * from OFFICE;

SNO

ID

NAME

AGE

BRANCH

1

101

Siraj

26

IT

2

102

Saran

26

IT

 

 

(3)   CHECK

insert into OFFICE values(03,103,'Samad',24,'DS');

 

ORA-02290: check constraint (SYSTEM.SYS_C004052) violated

 

 

(4)   DEFAULT

 

insert into OFFICE(sno,id,name,age) values(03,103,'Samad',27);

 
1 row(s) inserted.

 

select * from OFFICE;

 

SNO

ID

NAME

AGE

BRANCH

1

101

Siraj

26

IT

2

102

Saran

26

IT

3

103

Samad

27

CS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Experiment No: 6

Write SQL queries to demonstrate aggregate functions

 

Create Table Query:

create table samples(product varchar2(20), price number(5));

 

Insert one by one

insert into samples values('rice',56);

insert into samples values('sugar',36);

insert into samples values('Salt',18);

 

select * from samples;

 

PRODUCT

PRICE

rice

56

sugar

36

Salt

18

 

COUNT Function

select COUNT(*) from samples;

 

COUNT(*)

3

 

select COUNT(product) from samples;

COUNT(PRODUCT)

3

 

MAX Function

select MAX(price) from samples;

 

MAX(PRICE)

56

 

MIN Function

select MIN(price) from samples;

MIN(PRICE)

18

SUM Function

select SUM(price) from samples;

SUM(PRICE)

110

 

 

 

AVG Function

select AVG(price) from samples;

AVG(PRICE)

36.6666666666666666666666666666666666667

STDDEV Function

select STDDEV(price) from samples;

STDDEV(PRICE)

19.0087699058443372313948904094805429921

 

VARIANCE Function

select VARIANCE(price) from samples;

VARIANCE(PRICE)

361.333333333333333333333333333333333334

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

Experiment No: 7

Write SQL queries to demonstrate set operations

 

Create Table Query:

create table ibm(harddisk varchar2(20), speed varchar2(10), OS varchar2(30));

 



Table created.

 

Insert one by one

insert into ibm values('20gb','500Mhz','Linux');

1 row(s) inserted.

 

insert into ibm values('40gb','800Mhz','Windows');

1 row(s) inserted.
 

insert into ibm values('80gb','1Ghz','Windows');

 
1 row(s) inserted.

 

select * from ibm;

 

HARDDISK

SPEED

OS

20gb

500Mhz

Linux

40gb

800Mhz

Windows

80gb

1Ghz

Windows

 

Create Table Query:

create table dell(harddisk varchar2(20), speed varchar2(10), OS varchar2(30));

 

Table created.

 

Insert one by one

insert into dell values('20gb','500Mhz','Linux');

 

1 row(s) inserted.

 

insert into dell values('40gb','1Ghz','Windows');

 

1 row(s) inserted.

 

select * from dell;

 

HARDDISK

SPEED

OS

20gb

500Mhz

Linux

40gb

1Ghz

Windows

 

SET Operations

 

(1) UNION

select * from ibm UNION select * from dell;

 

HARDDISK

SPEED

OS

20gb

500Mhz

Linux

40gb

1Ghz

Windows

40gb

800Mhz

Windows

80gb

1Ghz

Windows

 

(2) INTERSECT

 

select * from ibm INTERSECT select * from dell;

 

HARDDISK

SPEED

OS

20gb

500Mhz

Linux

 

(3) MINUS

 

select * from ibm MINUS select * from dell;

 

HARDDISK

SPEED

OS

40gb

800Mhz

Windows

80gb

1Ghz

Windows

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

Experiment No: 8

 

Write a PL/SQL programme to find the biggest of two numbers (use ‘if’ )

 

DECLARE

      a number;

      b number;

BEGIN

      a := 100;

      b := 20;

      IF a>b THEN

          dbms_output.put_line(a||' is bigger');

      ELSE

          dbms_output.put_line(b||' is bigger');

      END IF;

END;

 

OUTPUT:

100 is bigger
 
Statement processed.

 

Experiment No: 9

Write a PL/SQL programme to display all the even numbers between 1 and 20

 

 

DECLARE

      a number;

BEGIN

      a := 1;

      WHILE a<21 LOOP

           IF (mod(a,2) = 0) THEN

              dbms_output.put_line(a);

           END IF;

           a := a + 1;

      END LOOP;

END;

 

OUTPUT:

 

2
4
6
8
10
12
14
16
18
20
 
Statement processed.

Experiment No: 10

A Cursor is a temporary work area created in the memory of the system when a DML statement is executed.

For Example, if the user wants data from the database, we execute a query in SQL as

SELECT eid, ename FROM Employees.

A Cursor can hold more than one row. The set of all these rows that the cursor holds is

called an active set. But... A Cursor can process only one row at a time.

There are four attributes used with Cursors :

1) %FOUND

2) %NOTFOUND

3) %ROWCOUNT

4) %ISOPEN

When these attributes are added to the cursor variable, they return some information about the

execution of the SQL Statement.

1) %FOUND

As the cursor processes one row at a time, if the cursor variable is appended with %FOUND

if the row was fetched successfully---It returns True

Otherwise                                       ----It returns False

Note : Before the first fetch from an open cursor, %FOUND returns NULL

2. %ROWCOUNT: It returns the number of records fetched from the cursor at that particular instance of time.

Note :

When a cursor is opened, %ROWCOUNT becomes zero . This means before the first fetch from an open cursor, %ROWCOUNT returns 0.

3. %ISOPEN: If the cursor is open-----It returns True

Otherwise ----It returns False

Two Types of Cursors :

1) Implicit Cursors : Implicit Cursors are created by default by the system when any DML statement gets executed.

2) Explicit Cursors : Explicit cursors must be created by us when we execute a SELECT statement that returns one or more rows.

Uses of Cursors:

1.     We can perform Row wise validation

2.     Operations on each row

Write PL/SQL program to display id, name and address of each customer using cursors

DECLARE

   c_id customers.id%type;

   c_name customers.name%type;

   c_addr customers.address%type;

   CURSOR c_customers is

      SELECT id, name, address FROM customers;

BEGIN

   OPEN c_customers;

   LOOP

   FETCH c_customers into c_id, c_name, c_addr;

      EXIT WHEN c_customers%notfound;

      dbms_output.put_line(c_id || ' ' || c_name || ' ' || c_addr);

   END LOOP;

   CLOSE c_customers;

END;

/

When the above code is executed at the SQL prompt, it produces the following result −

1 Ramesh Ahmedabad 

2 Khilan Delhi 

3 kaushik Kota    

4 Chaitali Mumbai 

5 Hardik Bhopal  

6 Komal MP   

PL/SQL procedure successfully completed.

 


 

Experiment No: 11

PROCEDURE

A procedure is a module that consists of a group of PL/SQL statements performs a task; it does not return any value. But, values can be passed into the procedure or fetched from the procedure through parameters. Procedures cannot be called directly from SELECT statements. They can be called from another block or through EXECUTE keyword.

Creating a Procedure

Basic syntax of creating a procedure in PL/SQL:

CREATE [OR REPLACE ] PROCEDURE procedure_name (parameter_list)

[IS | AS]

[declaration statements]

BEGIN

[execution statements]

EXCEPTION

[exception handler]

END [procedure_name ];

Where,

CREATE PROCEDURE instructs the compiler to create new procedure. Keyword 'OR REPLACE' instructs the compiler to replace the existing procedure (if any) with the current one.

Procedure name should be unique.

If the procedure is standalone then 'AS' will be used. Keyword 'IS' will be used, when the procedure is written in some other blocks.

Each parameter can be in either IN, OUT, or INOUT mode. The parameter mode specifies whether a parameter can be read from or write to.

o IN represents that value will be passed from outside into the procedure. It is a read-only parameter. It is the default mode of parameter passing. Parameters are passed by reference.

o OUT represents that this parameter will be used to return a value outside of the procedure. It is a write-only parameter. One can change its value and reference the value after assigning it. The actual parameter must be variable and it is passed by value.

o An INOUT parameter is both readable and writable. The procedure can read and modify it.

 

Standalone or Stored Procedure

The procedures that are stored in a database as database object and can be accessible throughout the database.

Creating a Standalone Procedure

The following example creates a simple procedure that displays the string ‘***Welcome to the AP CCE LMS***’ on the screen when executed.

CREATE OR REPLACE PROCEDURE greetings AS

BEGIN

DBM S_OUTPUT.PUT_LINE(‘***Welcome to the AP CCE LMS***’);

END;

/

When above code is executed using SQL prompt, it will produce the following result:

Procedure created.

Executing a Standalone Procedure

A standalone procedure can be called in two ways:

 Using the EXECUTE keyword

 Calling the name of the procedure from a PL/SQL block

 

The above procedure named 'greetings' can be called with the EXECUTE keyword as:

EXECUTE greetings;

The above call would display:

‘***Welcome to the AP CCE LMS***’

PL/SQL procedure successfully completed.

 

Write a PL/SQL  program to to create an Oracle procedure that takes the name as input and prints the welcome message as output. We are going to use EXECUTE command to call procedure.

CREATE OR REPLACE PROCEDURE welcome_msg (p_name IN VARCHAR2) 
IS
BEGIN
dbms_output.put_line (‘Welcome '|| p_name);
END;
/
 
EXECUTING PROCEDURE:
EXECUTE welcome_msg (‘Guru99’);
 
OUTPUT:
Welcome Guru99

 


 

Experiment No: 12

Functions is a standalone PL/SQL subprogram. Like PL/SQL procedure, functions have a unique name by which it can be referred. These are stored as PL/SQL database objects.

Procedure Vs. Function: Key Differences

Procedure

Function

  • Used mainly to a execute certain process
  • Used mainly to perform some calculation
  • Cannot call in SELECT statement
  • A Function that contains no DML statements can be called in SELECT statement
  • Use OUT parameter to return the value
  • Use RETURN to return the value
  • It is not mandatory to return the value
  • It is mandatory to return the value
  • RETURN will simply exit the control from subprogram.
  • RETURN will exit the control from subprogram and also returns the value
  • Return datatype will not be specified at the time of creation
  • Return datatype is mandatory at the time of creation

 

Write a PL/SQL programme to demonstrate functions.

 

CREATE OR REPLACE FUNCTION totalcustomers

RETURN NUMBER IS

       total NUMBER(2) := 0;

BEGIN

     SELECT COUNT(*) INTO total FROM emp1;

     RETURN total;

END;

 

O/P: Function created.

 

To use Function:

 

DECLARE

      c NUMBER(2);

BEGIN

     c := totalcustomers();

     dbms_output.put_line('Total number of customers:'||c);

END;

 

O/P:
Total number of customers:4
 
Statement processed.

Experiment No: 13

 

Triggers in oracle are blocks of PL/SQL code which oracle engine can execute automatically based on some action or event.

Triggers are automatically and repeatedly called upon by oracle engine on satisfying certain condition. If triggers are activated then they are executed implicitly by oracle engine.

Whenever a trigger is created, it contains the following three sequential parts:

1.      Triggering Event or Statement: The statements due to which a trigger occurs.

2.      Trigger Restriction: The condition or any limitation applied on the trigger. If condition is TRUE then trigger fires. Not all triggers has conditions.

3.      Trigger Action: The body containing the executable statements that is to be executed when trigger fires.

Types of Triggers

1)     Level Triggers

a)      ROW LEVEL TRIGGERS: It fires for every record that got affected. It always use a FOR EACH ROW clause

b)     STATEMENT LEVEL TRIGGERS: It fires once for each statement that is executed.

2)     Event Triggers

a)      DDL EVENT TRIGGER: It fires with the execution of every DDL statement(CREATE, ALTER, DROP, TRUNCATE).

b)     DML EVENT TRIGGER: It fires with the execution of every DML statement(INSERT, UPDATE, DELETE).

c)      DATABASE EVENT TRIGGER: It fires with the execution of every database operation which can be LOGON, LOGOFF, SHUTDOWN, SERVERERROR etc.

3)     Timing Triggers

a)      BEFORE TRIGGER: It fires before executing DML statement.

b)     AFTER TRIGGER: It fires after executing DML statement.

Example : Create a trigger that fires after insert of every new row in Stu table. The trigger automatically updates total.

create table Stu(id int, subj1 int,subj2 int,subj3 int,total int);

 

Table created.
 
Insert values

insert into Stu(id,subj1,subj2,subj3) values(1,30,25,62);

 

ID

SUBJ1

SUBJ2

SUBJ3

1

30

25

62

 

Output:

select * from Stu;

ID

SUBJ1

SUBJ2

SUBJ3

TOTAL

1

30

25

62

 


 

Create Trigger Command:

create or replace trigger stud_marks

after INSERT

on

Stu

for each row

begin

update Stu set total = subj1 + subj2 + subj3;

end;

/

 

Output:

select * from Stu;

ID

SUBJ1

SUBJ2

SUBJ3

TOTAL

1

30

25

62

117