Current Class Updated

CONDITION EXAMPLE

<html>
<head>
<script src="condition.js"></script>
</head>
<body>
<h1> condition example</h1>
<button onclick="one()"> if else</button>
<button onclick="two()"> if else if</button>
<button onclick="three()"> Nested if</button>
<button onclick="four()"> switch case</button>

<fieldset style="width:50%">
<legend>Out put area</legend>

<h3 id="msg"></h3>

</fieldset>
</body>
</html>

=================condition.js file code====================
function one()
{
var n1 = prompt("Enter any number");
var n2 = prompt("Enter 2nd number");

n1 = parseInt(n1);
n2 = parseInt(n2);

if(n1>n2)
{
document.getElementById("msg").innerHTML = "Hiher number is :"+n1;
}else{
document.getElementById("msg").innerHTML = "Hiher number is :"+n2;
}
}

function two()
{
var a = 20;
var b = 23;
var c = 20.00;
var data = "The higer number is :";

if((a>b) && (a>c))
{
data = data + a;
}
else if((b>a) && (b>c))
{
data = data + b;
}else{
data = data + c;
}

document.getElementById("msg").innerHTML = data;
}

function three()
{
var data = "Hi You are :";
var gender = prompt("What is your gender? enter male or female");
if(gender=="male")
{
var age = prompt("Please enter your age as number");
if(age>80)
{
data = data + "Very old";
}else{
data = data + " Mid Age";
}
}

else{
var qual = prompt("Please enter your qualification");
data = data + qual;
}

document.getElementById("msg").innerHTML = data;
}

function four()
{
var input = prompt("Please enter a number between 1 to 4");
switch(input)
{
case "1":
var data = "You have enter :" + input;
shodata(data);
break;

case "2":
var data = "You have enter:" + input;
shodata(data);
break;

case "3":
var data = "You have enter:" + input;
shodata(data);
break;

case "4":
var data = "You have enter:" + input;
shodata(data);
break;

default:
var data = "You have enter Invalid Input, Try again:" + input;
shodata(data);
four();
}
}

function shodata(data)
{
document.getElementById("msg").innerHTML = data;
}

MYSQL DDL & DML 8 AM

1. DDL (database definition language).
a. create database
b. drop database
c. create table
d. rename table
e. add new column (1 , multiple, begning of table middle, last)
f. rename column.
g. drop column.
h. drop table.
i. add index.
j. drop index.
k. add primary key, foreign key, constraint.
l. drop primary key, foreign key, constraint.
m. cretae trigger
n. drop trigger.
o. joins
p. ER Diagram
----------------------------------------------------------------
2. DML (database manipulation language) => all about data(insert, select, update, delete)
a. insert data (3 methods)
b. select data
c. update.
d. delete.
e. join query
--------------------------------------------------------------------
=> how to create database.
syntax:
create database <databasename>;
example:
create database myorg;
----------------------------------------
=>how to drop database;
syntax:
drop database <databasename>;
example:
drop database myorg;
------------------------------------------
=>how to create table.
syntax:
create table <tablename>
(
colname1 datatype(length) constraint,
colname2 datatype(length),
..............
..............
);
example:
create table user
(
userid int(10) primary key auto_increment,
fullname varchar(100),
emailid varchar(100),
city varchar(100),
mobile bigint(13)
);
----------------------------------------------------------
=> How to rename a table in mysql
syntax:
rename table <oldtablename> to <newtablename>;
example:
rename table user to customer;
-----------------------------------------------------------
=>add new column in begning of table
syntax:
alter table <tablename>
add <new_col_name> datatype(length) first;
example:
alter table customer
add gender varchar(20) first;
-----------------------------------------------------------
=>add new column in end of table
syntax:
alter table <tablename>
add <new_col_name> datatype(length);
example:
alter table customer
add state varchar(20);
----------------------------------------------------------
=> how to add multiple column same time on different location
example:

alter table customer
add dob date after mobile,
add age int(10) first,
add usertype varchar(20);
-----------------------------------------------------------------
=> how to show structure of table ?
a. explain
b. describe.
example:
explain customer;
describe customer;
-----------------------------------------------------------------
=> rename column in mysql.
syntax:
alter table <tablename>
change <old_col_name> <new_col_name> old/new datatype (old/new length);
example:
alter table customer
change usertype customertype varchar(255);
---------------------------------------------------------------------
=>drop an existing column from mysql table ?
syntax:
alter table <tablename>
drop column <colname>;
example:
alter table customer
drop column age;

=> drop multiple column together.
alter table customer
drop column state,
drop column city;
---------------------------------------------------
=> how to add index?
=> index will help to serach recoords faster.
syntax:
alter table <tablename>
add index <indexname>;
example:
alter table customer
add index(fullname);

=> Add multiple index:

alter table customer
add index(emailid),
add index(city),
add index(mobile);
-------------------------------------------
alter table customer
add index name(emailid,city,mobile);

------------------------------------------------
=> How to drop index from mysql table?
syntax:
alter table <tablename>
drop index <indexname>;
example:
alter table customer
drop index fullname;
--------------------------------------------------
=> drop table on mysql.
syntax:
drop table <tablename>;
example:
drop table customer;
--------------------------------------------------

create table emp
(
empid int(10) primary key auto_increment,
empname varchar(100),
empmobile bigint(13),
empcity varchar(100),
empgender enum('male','female') default 'male',
empage int(10),
empdept int(10),
emppsal int(10)
);
-----------------------------------------------------------
create table department
(
deptid int(10) primary key auto_increment,
deptname varchar(255),
depthead varchar(255)
);
-----------------------------------------------------------------
create table salary
(
sallid int(10) primary key auto_increment,
basic float,
ta float,
da float,
hra float,
medical float,
special float,
totalpaid float
);

--------------------------------------
ALTER TABLE emp
ADD CONSTRAINT empdept
FOREIGN KEY (empdept)
REFERENCES department(deptid);

---------------------------------------

ALTER TABLE emp
ADD CONSTRAINT emppsal
FOREIGN KEY (emppsal)
REFERENCES salary(sallid);

---------------------------------------
alter table emp
drop FOREIGN KEY emppsal;

alter table emp
drop FOREIGN KEY empdept;
=======================================

=>insert data in table
1.
syntax:

insert into <tablename>(colname1, colname2,colname3,...)
values('val1', 'val2', 'val3', ....)

example:
insert into emp(empname,empmobile,empcity)
values('Hari', '99999999','bangalore');

2.
insert into <tablename>
set
colname1 = 'newval',
colname2='newval',
colname3='newval';

example:

insert into emp
set
empname='Alex',
empmobile='99999999',
emppsal='5000',
empdept ='1';
3.
insert into <tablename>
value('val1', 'val2','val3','val4'......for all columns);

example:
insert into emp
values('', 'ABC','985785487','PUNE','MALE','25','2','60000');

insert into emp
values('', 'ABC','985785487','PUNE','','25','2','60000');

------------------------------------------------
insert into emp(empname,empmobile,empcity,empgender)
values('Hari', '99999999','bangalore','ABC');
--------------------------------------------------------------------------
=>insert multiple row at same time.

insert into emp(empname,empmobile,empcity,emppsal)
values('Gnesh','8888888','delhi','52000'),
('mhesh','666666','pune','879876'),
('mohit','6767676','chennai','8522'),
('rohit','989898','bangalore','99999');

insert into emp(empname,empmobile,empcity,emppsal)
values('abc','8888888','delhi','89898'),
('xyz','666666','pune','56565'),
('mno','6767676','chennai','3434'),
('abc','989898','bangalore','89899');
==============================================================================
=>select/fetch
1. syntax:
select * from <tablename>;
example:
select * from emp;

note: it will return all rows and all columns
---------------------------------
2. syntax:
select colname1, colname2, colname3 from <tablename>;
example:

select empname, emppmobile, empgender from emp;

Note: it will return all rows but specific columns.
--------------------------------------------------------------------------
=> ORDER BY
->it will display the records in some order as ASCENDING/DESCENDING.
for string data type column it arrange as alphabatic, for numeric it arrange according to value of number.

syntax:
select * from <tablename> order by <colname> asc/ desc;
example:
select * from emp order by empname asc;
select * from emp order by emppsal asc;

select * from emp order by empname desc;
select * from emp order by emppsal desc;
---------------------------------------------------------------
=> GROUP BY
->to filter unique records from table.but it will return all columns.
syntax:
select * from <tablename> group by <colname>;
example:
select * from emp group by empcity order by empcity desc;
-----------------------------------------------------------------------------
=>Between
->to filter/serach records between given range.
syntax:
select * from <tablename> where <colname> between <minval> and <maxval>;
example:
select * from emp where emppsal between 5000 and 10000 order by emppsal asc;
-------------------------------------------------------------------------------------
=>IN/NOT IN
->to select/filter records random.

IN : syntax:
select * from <tablename> where <colname> IN('val1' , 'val2', 'val3'.....);
example:
select * from emp where empid IN(1,6,99,2);
Note: it will include the specified values records.
---------------------------
NOT IN : syntax:
select * from <tablename> where <colname> NOT IN('val1' , 'val2', 'val3'.....);
example:
select * from emp where empid NOT IN(1,6,99,2);

Note: it will exclude the specified values records.
------------------------------------------------------------------
LIKE:
-> to serch records on given patern.
syntax:
select * from <tablename> where <colname> like 'pattern';

1. example:
select * from emp where empname like 'a%'; // the empname start with a char.

2. example:
select * from emp where empname like '%a'; // the empname end with a char.

3. example:
select * from emp where empname like '%a%';

// to find those empname have a char any where .

4. example:
select * from emp where empname like '_a%';

//2nd char should be a from strating

5. select * from emp where empname like '%a_';

--------------------------------------------------------------
=>Trigger
=>to do auto action(to take backup, delete, update, insert, etc...)
1. update
2. delete
----------------------------------------------------------
insert into empbackup
set

empid = old.empid,
empname = old.empname,
empmobile = old.empmobile,
empcity = old.empcity,
empgender = old.empgender,
empage = old.empage,
empdept = old.empdept,
emppsal = old.emppsal,
comment = 'When employee details was changed';
-------------------------------------------------------------
CREATE TRIGGER `empupdate` BEFORE UPDATE ON `emp` FOR EACH ROW insert into empbackup set empid = old.empid, empname = old.empname, empmobile = old.empmobile, empcity = old.empcity, empgender = old.empgender, empage = old.empage, empdept = old.empdept, emppsal = old.emppsal, comment = 'When employee details was changed';

=>cursore ->pending
=>procedure ->pending
=>trigger ->yes
=>
primary key : it is column of table which make relation between 2 or more tables
entity entigrity :
1. it should not contain nullvalue.
2. it should not contain duplicate calue.
---------------------------------------------------
foreignn key : it is column of table which make relation between 2 tables
referencial entigrity :
1. it should not contain null value.
2. it should contain same as primary key value.
-------------------------------------------------------------------
JOIN:
=>to retrive/fetch/select records from multiple interrelated tables.
----------------------------------------------------
direct join : to retrive complete matching records
syntax:
select table1.*, table2.*
from table1, table2
where
table1.primary key = table2. foreign key
example:

select department.*, emp.*
from department, emp
where
department.deptid = emp.empdept;
----------------------------------------------------------------
select department.*, emp.*,salary.*
from department, emp,salary
where
department.deptid = emp.empdept
and emp.empid = salary.empid;
-----------------------------------------------------------------
select department.deptname,
emp.empname,
emp.empmobile,
salary.*
from department, emp,salary
where
department.deptid = emp.empdept
and emp.empid = salary.empid;
-----------------------------------------------------------------
select d.deptname,
e.empname,
e.empmobile,
s.*

from department as d, emp as e,salary as s
where
d.deptid = e.empdept
and e.empid = s.empid;
-------------------------------------------------------------------
INNER JOIN :
to retrive/fetch/select records from multiple interrelated tables.
=>
syntax:
select table1.*, table2.*
from table1
INNER JOIN table2
on table1.primary key = table2.foreign key;
--------------------------------------------------------------
example:
select department.*, emp.*,salary.*
from department
inner join emp
on department.deptid = emp.empdept

inner join salary
on emp.empid = salary.empid;
--------------------------------------------------------------
LEFT JOIN
=>to fetch all records from main table and only matching records from dependents tables.

syntax:
select table1.*, table2.*
from table2
left join table1
on table1.primary key = table2.foreign key;

example:
select department.*,emp.*
from emp
left join department
on emp.empdept = department.deptid;
--------------------------------------------------
select department.*,emp.*
from department
left join emp
on department.deptid = emp.empdept;

-----------------------------------------------------
select department.*,emp.*,salary.*
from department
left join emp
on department.deptid = emp.empdept

left join salary
on emp.empid = salary.empid
--------------------------------------------------------
RIGHT JOIN
=>to fetch all records from dependent tables and only matching records from main tables.

syntax:
select table1.*, table2.*
from table2
left join table1
on table1.primary key = table2.foreign key;
---------------------------------------------------------------
example:
select department.*,emp.*
from department
right join emp
on department.deptid = emp.empdept
order by emp.empid;
----------------------------------------------------------------
select department.*,emp.*
from department
right OUTER join emp
on department.deptid = emp.empdept
order by emp.empid;

select department.*,emp.*
from department
LEFT OUTER join emp
on department.deptid = emp.empdept
order by emp.empid;

SELECT deptid FROM department
UNION
SELECT empdept FROM emp

SELECT deptid FROM department
UNION ALL
SELECT empdept FROM emp
------------------------------------------------------------------

MYSQL DDL

1. DDL (database definition language).
a. create database
b. drop database
c. create table
d. rename table
e. add new column (1 , multiple, begning of table middle, last)
f. rename column.
g. drop column.
h. drop table.
i. add index.
j. drop index.
k. add primary key, foreign key, constraint.
l. drop primary key, foreign key, constraint.
m. cretae trigger
n. drop trigger.
o. joins
p. ER Diagram
----------------------------------------------------------------
2. DML (database manipulation language) => all about data(insert, select, update, delete)
a. insert data (3 methods)
b. select data
c. update.
d. delete.
e. join query
--------------------------------------------------------------------
=> how to create database.
syntax:
create database ;
example:
create database myorg;
----------------------------------------
=>how to drop database;
syntax:
drop database ;
example:
drop database myorg;
------------------------------------------
=>how to create table.
syntax:
create table
(
colname1 datatype(length) constraint,
colname2 datatype(length),
..............
..............
);
example:
create table user
(
userid int(10) primary key auto_increment,
fullname varchar(100),
emailid varchar(100),
city varchar(100),
mobile bigint(13)
);
----------------------------------------------------------
=> How to rename a table in mysql
syntax:
rename table to ;
example:
rename table user to customer;
-----------------------------------------------------------
=>add new column in begning of table
syntax:
alter table
add datatype(length) first;
example:
alter table customer
add gender varchar(20) first;
-----------------------------------------------------------
=>add new column in end of table
syntax:
alter table
add datatype(length);
example:
alter table customer
add state varchar(20);
----------------------------------------------------------
=> how to add multiple column same time on different location
example:

alter table customer
add dob date after mobile,
add age int(10) first,
add usertype varchar(20);
-----------------------------------------------------------------
=> how to show structure of table ?
a. explain
b. describe.
example:
explain customer;
describe customer;
-----------------------------------------------------------------
=> rename column in mysql.
syntax:
alter table
change old/new datatype (old/new length);
example:
alter table customer
change usertype customertype varchar(255);
---------------------------------------------------------------------
=>drop an existing column from mysql table ?
syntax:
alter table
drop column ;
example:
alter table customer
drop column age;

=> drop multiple column together.
alter table customer
drop column state,
drop column city;
---------------------------------------------------
=> how to add index?
=> index will help to serach recoords faster.
syntax:
alter table
add index ;
example:
alter table customer
add index(fullname);

=> Add multiple index:

alter table customer
add index(emailid),
add index(city),
add index(mobile);
-------------------------------------------
alter table customer
add index name(emailid,city,mobile);

------------------------------------------------
=> How to drop index from mysql table?
syntax:
alter table
drop index ;
example:
alter table customer
drop index fullname;
--------------------------------------------------
=> drop table on mysql.
syntax:
drop table ;
example:
drop table customer;
--------------------------------------------------

create table emp
(
empid int(10) primary key auto_increment,
empname varchar(100),
empmobile bigint(13),
empcity varchar(100),
empgender enum('male','female') default 'male',
empage int(10),
empdept int(10),
emppsal int(10)
);
-----------------------------------------------------------
create table department
(
deptid int(10) primary key auto_increment,
deptname varchar(255),
depthead varchar(255)
);
-----------------------------------------------------------------
create table salary
(
sallid int(10) primary key auto_increment,
basic float,
ta float,
da float,
hra float,
medical float,
special float,
totalpaid float
);

--------------------------------------
ALTER TABLE emp
ADD CONSTRAINT empdept
FOREIGN KEY (empdept)
REFERENCES department(deptid);

---------------------------------------

ALTER TABLE emp
ADD CONSTRAINT emppsal
FOREIGN KEY (emppsal)
REFERENCES salary(sallid);

---------------------------------------

example Three

<html>
<head>
<script src="js/angular.js"></script>
</head>
<body>
<div ng-app="" ng-init="item=['apple',100,'mango',100.50]">
<h1>NG INIT FOR ARRAY VARIABLES</h1>
<p>{{item[3] + item[1] }}</p>
<p>
<ul>
<li ng-repeat="x in item"> {{x}}</li>
</ul>
</p>
</div>
</body>
</html>

example two

<html>
<head>
<script src="js/angular.js"></script>
</head>
<body>
<div ng-app="" ng-init="a=100; b=200;">
<h1>NG INIT FOR SIGNLE VARIABLES</h1>
<input type="text" ng-model="a">
No : <input type="text" ng-model="a">
No : <input type="text" ng-model="b">
<p>{{a + b }}</p>
<p ng-bind="a + b"></p>
<p ng-bind-html="abc"></p>
<p><input type="text" ng-model=" a + b "></p>
</div>
</body>
</html>

Best Manual Testing Training With 100% Job Support (Training By 8 Years Experienced Professional)

Best Manual Testing Training Institute In Bangalore Marathahalli & BTM

Manual Testing Main Topic Covered

Fundamentals of Testing
Testing throughout the software life cycle
Static Techniques
Test Design Techniques
Test Management
Other Testing Types
Introducing Quality Center
Specifying Releases and Cycles & Planning Tests
Planning Tests and Running Tests,Adding and Tracking Defects

Subscribe to INFOCAMPUS RSS

100% Placement Program

JOB Assurance: Our Placement Officer will send for Interviews till you Get Placed
Interview Q & A provided which are frequently asked in Companies
Real Case Studies/Examples provided to clear Interviews Easily
Practical Knowledge Training on Every Topic

Student Free Benefits

We Provide Live Projects for you to Practice
Free Job Assistance and Certification
Free Technical Support even after getting job
Backup Classes for missing topics
Lab Facility , Wifi, Led TV Projector Career Counselling
Mock Exams and Mock Interviews Conducted

Courses Duration

45 - 50 Hours of Thoery and Pratical Classes
Weekdays and Weekends Classes Available
Get In-Depth Practical Knowledge on each Topic with example
Pay Fees in Installments
Attend 4 Class Free
Classroom, Online & Corporate Training