GIRIDHARAN

The happiness of your life depends on the quality of your thoughts.

Technology

     Simple Pricing Table Using CSS3

Simple-Pricing-Table-Using-CSS3

 

HTML PAGE:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
<title>Simple Pricing Table Using CSS3</title>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>

<body>
<div class="container">

<div class="box">
<div class="acc">Free</div>
<div class="icon"></div>
<ul>
<li>10 GB Disk Space</li>
<li>100 GB Bandwidth</li>
<li>2 cPanel</li>
<li>100 Email</li>
<li>1 Database</li>
<li>No Dedicated IP</li>
<li class="amt">$15</li>
</ul>
</div>

<div class="box">
<div class="acc">Diamond</div>
<div class="icon"></div>
<ul>
<li>20 GB Disk Space</li>
<li>200 GB Bandwidth</li>
<li>5 cPanel</li>
<li>500 Email</li>
<li>5 Database</li>
<li>No Dedicated IP</li>
<li class="amt">$30</li>
</ul>
</div>

<div class="box">
<div class="acc">Premium</div>
<div class="icon"></div>
<ul>
<li>50 GB Disk Space</li>
<li>500 GB Bandwidth</li>
<li>5 cPanel</li>
<li>1000 Email</li>
<li>10 Database</li>
<li>1 Dedicated IP</li>
<li class="amt">$45</li>
</ul>
</div>
<br /><br /><br />
</div>
</body>
</html>

CSS PAGE:

.container
{
width: 800px;
margin: 150px auto;
min-height:700px;
}
.icon
{
background: url(icon.png) no-repeat;
background-size: 21%;
background-position: 50% 0%;
margin: 10px auto;
height: 47px;
}
.acc{
background-color: #F7D835;
text-align: center;
padding: 22px 0;
font-size: 19px;
text-transform: uppercase;
font-family: "Oswald", sans-serif, arial;
}
.box
{
float: left;
margin:0 15px;
transition:all 0.3s;
}
.box:hover
{
transform: scale(1.05, 1.05);
-webkit-transform: scale(1.05, 1.05);
-moz-transform: scale(1.05, 1.05);
-ms-transform: scale(1.05, 1.05);
-o-transform: scale(1.05, 1.05);
box-shadow: 1px 1px 30px #ccc;
-webkit-box-shadow: 1px 1px 30px #ccc;
-moz-box-shadow: 1px 1px 30px #ccc;
-ms-box-shadow: 1px 1px 30px #ccc;
-o-box-shadow: 1px 1px 30px #ccc;

}
.box ul
{
list-style: none;
margin: 0;
padding: 0;
}
.box ul li
{
font-family: sans-serif;
font-size: 14px;
background-color: #E9E9E9;
margin: 0px;
padding: 10px 50px;
text-align:center;
}

.amt
{
font-size: 37px!important;
font-family: Georgia, "Times New Roman", Times, serif!important;
text-align: center;
background-color: #575757!important;
color: #FFF!important;
}

.box ul li:nth-child(2n) {
background-color: #C2C2C2;
}

 

COMPLEX QUERIES IN SQL

  1. To Fetch Alternate Records From a Table. (even Numbered)

Ans:  select * from emp where rowid in (select decode(mod(rownum,2),0,rowid, null) from emp);

  1. To Select Alternate Records From a Table. (odd Numbered)

Ans: select * from emp where rowid in (select decode(mod(rownum,2),0,null ,rowid) from emp);

  1. Find The 3rd Max Salary In The Emp Table.

Ans: select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp e2 where e1.sal <= e2.sal);

  1. Find The 3rd Min Salary In The Emp Table.

Ans: select distinct sal from emp e1 where 3 = (select count(distinct sal) from emp e2 where e1.sal >= e2.sal);

  1. Select First N Records From a Table.

Ans: select * from emp where rownum <= &n;

  1. Select LAST n records from a table

Ans: select * from emp minus select * from emp where rownum <= (select count(*) – &n from emp);

  1. List Dept No., Dept Name For All The Departments In Which There Are No Employees In The Department.

Ans: select * from dept a where not exists (select * from emp b where a.deptno = b.deptno);

  1. How To Get 3 Max Salaries ?

Ans: select distinct sal from emp a where 3 >= (select count(distinct sal) from emp b where a.sal <= b.sal) order by a.sal desc;

  1. How To Get 3 Min Salaries ?

Ans: select distinct sal from emp a  where 3 >= (select count(distinct sal) from emp b  where a.sal >= b.sal);

  1. How To Get Nth Max Salaries ?

Ans:  select distinct hiredate from emp a where &n =  (select count(distinct sal) from emp b where a.sal >= b.sal);

  1. Select Distinct Records From Emp Table.

Ans:  select * from emp a where  rowid = (select max(rowid) from emp b where  a.empno=b.empno);

  1. How To Delete Duplicate Rows In A Table?

Ans:  delete from emp a where rowid != (select max(rowid) from emp b where  a.empno=b.empno);

  1. Count Of Number Of Employees In Department 

Ans: select count(empno), b.deptno, dname from emp a, dept b  where a.deptno(+)=b.deptno  group by b.deptno,dname;

  1. Suppose There Is Annual Salary Information Provided By Emp Table. How To Fetch Monthly Salary Of Each And Every Employee?

Ans:  select ename,sal/12 as monthlysal from emp;

  1. Select All Record From Emp Table Where Deptno =10 Or 40.

Ans:  select * from emp where deptno=30 or deptno=10;

  1. Select All Record From Emp Table Where Deptno=30 And Sal>1500.

Ans:  select * from emp where deptno=30 and sal>1500;

  1. Select All Record  From Emp Where Job Not In Salesman  Or Clerk.

Ans: select * from emp where job not in (‘salesman’,’clerk’);

  1. Select All Record From Emp Where Ename In ‘blake’,’scott’,’king’and’ford’.

Ans: select * from emp where ename in(‘jones’,’blake’,’scott’,’king’,’ford’);

  1. Select All Records Where Ename Starts With ‘s’ And Its Lenth Is 6 Char.

Ans:  select * from emp where ename like’s____’;

  1. Select All Records Where Ename May Be Any No Of Character But It Should End With ‘r’.

Ans:  select * from emp where ename like’%r’;

  1. Count Mgr And Their Salary In Emp Table.

Ans:  select count(mgr),count(sal) from emp;

  1. In Emp Table Add Comm+sal As Total Sal .

Ans:   select ename,(sal+nvl(comm,0)) as totalsal from emp

  1. Select Any Salary <3000 From Emp Table.

Ans: select * from emp  where sal> any(select sal from emp where sal<3000);

  1. Select All Salary <3000 From Emp Table.

Ans:  select * from emp  where sal> all(select sal from emp where sal<3000);

  1. Select All The Employee Group By Deptno And Sal In Descending Order.

Ans: select ename,deptno,sal from emp order by deptno,sal desc;

  1. How Can I Create An Empty Table Emp1 With Same Structure As Emp?

Ans:  create table emp1 as select * from emp where 1=2;

  1. How To Retrive Record Where Sal Between 1000 To 2000?

Ans: select * from emp where sal>=1000 and  sal<2000

  1. Select All Records Where Dept No Of Both Emp And Dept Table Matches.

Ans:  select * from emp where exists(select * from dept where emp.deptno=dept.deptno)

  1. If There Are Two Tables Emp1 And Emp2, And Both Have Common Record. How Can I Fetch All The Recods But Common Records Only Once?

Ans:  (select * from emp) union (select * from emp1)

  1. How To Fetch Only Common Records From Two Tables Emp And Emp1?

Ans:  (select * from emp) intersect (select * from emp1)

  1. How Can I Retrive All Records Of Emp1 Those Should Not Present In Emp2?

Ans:  (select * from emp) minus (select * from emp1)

  1. Count The Totalsa Deptno Wise Where More Than 2 Employees Exist.

Ans: SELECT  deptno, sum(sal) As totalsal  FROM emp GROUP BY deptno HAVING COUNT(empno) > 2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: