Wednesday, October 24, 2012

Joins 22-10-12







The HAVING Clause

The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions.

SQL HAVING Syntax

SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value


 SELECT Customer,SUM(OrderPrice) FROM Orders
GROUP BY Customer
HAVING SUM(OrderPrice)<2000



SELECT Customer,SUM(OrderPrice) FROM Orders
WHERE Customer='Hansen' OR Customer='Jensen'
GROUP BY Customer
HAVING SUM(OrderPrice)>1500


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

SELECT Customer,SUM(OrderPrice) FROM Orders
GROUP BY Customer


SQL CREATE VIEW Statement

In SQL, a view is a virtual table based on the result-set of an SQL statement.
A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database.
You can add SQL functions, WHERE, and JOIN statements to a view and present the data as if the data were coming from one single table.

SQL CREATE VIEW Syntax

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

SQL CREATE VIEW Examples

If you have the Northwind database you can see that it has several views installed by default.
The view "Current Product List" lists all active products (products that are not discontinued) from the "Products" table. The view is created with the following SQL:
CREATE VIEW [Current Product List] AS
SELECT ProductID,ProductName
FROM Products
WHERE Discontinued=No
We can query the view above as follows:
SELECT * FROM [Current Product List]
Another view in the Northwind sample database selects every product in the "Products" table with a unit price higher than the average unit price:
CREATE VIEW [Products Above Average Price] AS
SELECT ProductName,UnitPrice
FROM Products
WHERE UnitPrice>(SELECT AVG(UnitPrice) FROM Products)
We can query the view above as follows:
SELECT * FROM [Products Above Average Price]
Another view in the Northwind database calculates the total sale for each category in 1997. Note that this view selects its data from another view called "Product Sales for 1997":
CREATE VIEW [Category Sales For 1997] AS
SELECT DISTINCT CategoryName,Sum(ProductSales) AS CategorySales
FROM [Product Sales for 1997]
GROUP BY CategoryName
We can query the view above as follows:
SELECT * FROM [Category Sales For 1997]
We can also add a condition to the query. Now we want to see the total sale only for the category "Beverages":
SELECT * FROM [Category Sales For 1997]
WHERE CategoryName='Beverages'


SQL Updating a View

You can update a view by using the following syntax:

SQL CREATE OR REPLACE VIEW Syntax

CREATE OR REPLACE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
Now we want to add the "Category" column to the "Current Product List" view. We will update the view with the following SQL:
CREATE VIEW [Current Product List] AS
SELECT ProductID,ProductName,Category
FROM Products
WHERE Discontinued=No


SQL Dropping a View

You can delete a view with the DROP VIEW command.

SQL DROP VIEW Syntax

DROP VIEW view_name
SELECT column_name(s)
FROM table_name1
FULL JOIN table_name2
ON table_name1.column_name=table_name2.column_name




SQL INNER JOIN Keyword

The INNER JOIN keyword returns rows when there is at least one match in both tables.

SQL INNER JOIN Syntax

SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
PS: INNER JOIN is the same as JOIN.

SQL INNER JOIN Example

The "Persons" table:
P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger
The "Orders" table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15
Now we want to list all the persons with any orders.
We use the following SELECT statement:
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
INNER JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName
The result-set will look like this:
LastName FirstName OrderNo
Hansen Ola 22456
Hansen Ola 24562
Pettersen Kari 77895
Pettersen Kari 44678
The INNER JOIN keyword returns rows when there is at least one match in both tables. If there are rows in "Persons" that do not have matches in "Orders", those rows will NOT be listed.



SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.

SQL JOIN

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables.
Tables in a database are often related to each other with keys.
A primary key is a column (or a combination of columns) with a unique value for each row. Each primary key value must be unique within the table. The purpose is to bind data together, across tables, without repeating all of the data in every table.
Look at the "Persons" table:
P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger
Note that the "P_Id" column is the primary key in the "Persons" table. This means that no two rows can have the same P_Id. The P_Id distinguishes two persons even if they have the same name.
Next, we have the "Orders" table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15
Note that the "O_Id" column is the primary key in the "Orders" table and that the "P_Id" column refers to the persons in the "Persons" table without using their names.
Notice that the relationship between the two tables above is the "P_Id" column.

Different SQL JOINs

Before we continue with examples, we will list the types of JOIN you can use, and the differences between them.
  • JOIN: Return rows when there is at least one match in both tables
  • LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table
  • RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table
  • FULL JOIN: Return rows when there is a match in one of the tables




With SQL, an alias name can be given to a table or to a column.

SQL Alias

You can give a table or a column another name by using an alias. This can be a good thing to do if you have very long or complex table names or column names.
An alias name could be anything, but usually it is short.

SQL Alias Syntax for Tables

SELECT column_name(s)
FROM table_name
AS alias_name

SQL Alias Syntax for Columns

SELECT column_name AS alias_name
FROM table_name


Alias Example

Assume we have a table called "Persons" and another table called "Product_Orders". We will give the table aliases of "p" and "po" respectively.
Now we want to list all the orders that "Ola Hansen" is responsible for.
We use the following SELECT statement:
SELECT po.OrderID, p.LastName, p.FirstName
FROM Persons AS p,
Product_Orders AS po
WHERE p.LastName='Hansen' AND p.FirstName='Ola'
The same SELECT statement without aliases:
SELECT Product_Orders.OrderID, Persons.LastName, Persons.FirstName
FROM Persons,
Product_Orders
WHERE Persons.LastName='Hansen' AND Persons.FirstName='Ola'
As you'll see from the two SELECT statements above; aliases can make queries easier both to write and to read.








Joins 22-10-12


create database coursecatalogs
create table student (reg_no int primary key, s_name varchar(20),
 course_enrolled varchar(20), Section varchar(20) )
select * from student
insert into student values (101, 'abc', 'diploma', 'jk001')
insert into student values (102, 'xyz', 'b.tech', 'rk201')
insert into student values (103, 'qrs', 'diploma', 'jk002')
insert into student values (104, 'twy', 'mba', 'pq601')
create table course (course_code varchar(20) primary key, course_name varchar(20),
 course_duration int, reg_no int foreign key references student (reg_no) )

insert into course values ('CSE200', 'mang DBMS', 5, 101)
insert into course values ('MG7400', 'finance mgmt', 4, 102)
insert into course values ('CSE306', 'com netwks', 3, 101)
insert into course values ('INT201','Graphic tools', 2, 103)
insert into course values ('INT204','web development', 3, null)
select * from course

 select student.reg_no, student.s_name, c.course_name from student cross join course c /* cross join */

select  s.s_name, s.Section, c.course_name from student s inner join course c
 on s.reg_no = c.reg_no where s.Section = 'jk001' or s.Section = 'jk001'

select  s.s_name, s.Section, c.course_name from student s inner join course c  on s.reg_no > c.reg_no

select  s.s_name, s.Section, c.course_name
from student s, course c  where s.reg_no = c.reg_no  /* older method equi join */

select  s.s_name, s.Section, c.course_name
from student s, course c  where s.reg_no > c.reg_no  /* older method non equi join */

select  s.s_name, s.Section, c.course_name from student s, course c /* cross join older method*/

select  s.s_name, s.Section, c.course_name
from student s full outer join course c  on s.reg_no = c.reg_no /* outer join */

create table teacher (teacher_id int primary key , teacher_name varchar(20), t_salary float,
 course_code varchar(20) foreign key references course (course_code) )

insert into teacher values ( 1300, 'aabc' ,10000 ,'CSE200')
insert into teacher values ( 1301, 'xyzq' ,15000 ,'CSE306')
insert into teacher values ( 1302, 'qrst' ,20000 ,NULL)
insert into teacher values ( 1304, 'xyzq' ,2000 ,'CSE306')
insert into teacher values ( 1305, 'qvwx' ,3000 ,null)

select * from teacher
-------------------------------------------

Execution Ques Odd

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



create table teacher (teacher_id int primary key , teacher_name varchar(20), t_salary float,
 course_code varchar(20) foreign key references course (course_code) )

insert into teacher values ( 1300, 'aabc' ,10000 ,'CSE200')
insert into teacher values ( 1301, 'xyzq' ,15000 ,'CSE306')
insert into teacher values ( 1302, 'qrst' ,20000 ,NULL)
insert into teacher values ( 1304, 'xyzq' ,2000 ,'CSE306')
insert into teacher values ( 1305, 'qvwx' ,3000 ,null)
select * from teacher

/* 1 */
select t.teacher_id, t.t_salary, c.course_name from teacher t cross join course c

/* 2 */
select 'Teacher '+t.teacher_name +' having salary '+ cast(t.t_salary as varchar)+ ' teaching course ' + c.course_name +  c.course_code from teacher t  inner join course c on t.course_code = c.course_code


/* 3 */




LAB 3


LAB 3
03-09-12,

create database library
create table book(book_isbn_no int , title varchar(40), author varchar(35), price float)
select * from book
sp_help book
insert into book values(101, NULL, 'Abc', 550.64)
insert into book values(102, 'Database Management', 'XYZ', 456.76)
insert into book values(103, 'Programming in C', NULL, 750.47)
alter table book add quantity int
insert into book (quantity) values(45)
update book set quantity = 45 where author = 'Abc'
delete from book where book_isbn_no is NULL
update book set quantity = 50 where author = 'XYZ'
update book set quantity = 25 where author is NULL
update book set author = 'QRS' where quantity = 25
insert into book values(NULL, NULL, NULL, NULL, NULL)
update book set book_isbn_no = 104 where book_isbn_no is NULL
update book set title = 'Programming in C' where book_isbn_no = 104
update book set author = 'RST' where book_isbn_no = 104
update book set price = 550.67 where book_isbn_no = 104
update book set quantity = 35 where book_isbn_no = 104
select distinct title from book
select book_isbn_no , title from book
select title as BookTitle ,  author "Book Author" from book
select title+author "Book Info" , price from book
update book set title = 'MCP' where quantity = 45
select 'Book having ISBN no ' + cast(book_isbn_no as varchar(10)) + ' with Title '+ title "Book info" from book

---------------------------------------------------------------------------------------
Execution Question

create table staff(staff_id int ,staff_name varchar(20), no_of_books int , salary float)
insert into staff values (1001, 'Abc', 12 , 5000.789)
select * from staff
insert into staff values (1002, 'XYZ', 10 , 6000.769)
insert into staff values (1003, 'QRS', 20 , 7000.989)
insert into staff values (NULL, NULL , NULL , NULL)
update staff set staff_id = 1004 where staff_id is NULL
update staff set salary = 4000.896 where staff_id = 1004
select staff_name " Staff Name" , salary "Salary"  from staff
select 'Staff Id No ' + cast(staff_id as varchar(10)) + ' with name " '+ staff_name + ' " and having salary = ' + cast(salary as varchar(10)) "Salary Info" from staff

SQL Lab 2

Group 1 JK001
Date : 27-08-12  Lab No : 2



drop database movies

create database movies
create database hospital_management_sys
create table doctor(doctor_Id int, doctor_name varchar(20), doctor_salery int)
sp_help doctor
sp_tables
alter table doctor add hire_date datetime
alter table doctor add doctor_specialization varchar
alter table doctor drop column doctor_specialization
sp_help doctor
create table test(Id int, name varchar)
sp_help test
drop table test
sp_tables
insert into doctor values (1, 'prab', 3000, '12-02-2011')
select * from doctor
insert into doctor (doctor_id , doctor_salery) values(3,5000)
update doctor set doctor_Id = 10 where doctor_Id = 5
update doctor set doctor_name = 'kaji' where doctor_Id = 10
update doctor set hire_date = '11-04-2011' where doctor_Id = 10

insert into doctor values(2,'guri',10000,'09-01-2010')

------------------------------------------- XXXXXXXXXXXXXX-----------------------------------


create database movies
create table booking(bid int,custname varchar(20),bdate datetime)
sp_help booking
alter table booking add rating int
alter table booking drop column bdate
sp_help booking
create table show(sid int,sname varchar(20))
alter table show add showtime datetime
drop table show
insert into booking values(101,'xyz',5)
insert into booking values(102,'pqr',6)
insert into booking values(103,'lmn',3)
insert into booking values(104,'abc',4)
select * from booking
insert into booking(bid,custname)values(105,'bbb')
select * from booking
insert into booking(bid,rating)values(106,8)
select * from booking
update booking set custname='aaa' where bid=106
select * from booking
update booking set rating=5 where custname='bbb'
select * from booking
delete from booking where rating=5
select * from booking
delete from booking
select * from booking
truncate table booking
select * from booking
drop table booking
select * from booking
create database foodcourt
create table shop1(shopbid int,shopname varchar(20))
insert into shop1 values(20,'indian')
insert into shop1 values(30,'chinese')
insert into shop1 values(40,'thai')
insert into shop1 values(50,'continentel')
select * from shop1
alter table shop1 add area int
select * from shop1
update shop1 set area=5000 where  area=null
select * from shop1

------------------------------------------- XXXXXXXXXXXXXX-----------------------------------
Execution Question


create database building_info
create table cityland (cityland_no int, cityland_area int , cityland_type varchar)
sp_help cityland
alter table cityland add cityland_price float
alter table cityland drop column cityland_type
insert into cityland values (1001,5000,4678.76)
select * from cityland
insert into cityland (cityland_price) values (8695.56)
insert into cityland (cityland_no, cityland_price) values (1003,5643.68)
insert into cityland (cityland_no, cityland_area) values (1004,7000)
update cityland set cityland_no = 1002 where cityland_price = 8695.56
update cityland set cityland_area = 4000 where cityland_price = 8695.56
delete from cityland where cityland_area = 7000
select * from cityland


Thursday, October 11, 2012

Html Mail to


Useful HTML

The mailto protocol provides a convenient way to entice visitors to your website into contacting you. Clicking a mailto-link is designed to trigger an application external to the browser, the email client, that opens windows to a whole new level of personal contact. However, some drawbacks that may not be immediately apparent have led to irresponsible use of the possibility and a tainted reputation of the protocol.

From mailto message

To be of any use, a user must visit your site from his own computer with an email client installed that is registered with the browser and his own email address as the default sender. While this may be the natural situation for some, it certainly isn't that for those who rely on internet-café's for example for their surfing needs, or share their machine with family or roommates. People with computers at home and at work and different email addresses ‘installed’ on each, may visit your website from one station, and prefer to receive the reply at the other. And vice versa.
In short, interweaving email traffic with the open Internet takes more than a click. The most proper approach remains a serverside script, written in Perl, PHP, ASP, or YNI*, to take care of the actual sending, following the same old logic that there is an environment of known capabilities, and while browsers may live under mysterious circumstances with no email client in sight, they can send forms to the server all by themselves since HTML 2.0!
Not least, publishing email addresses online in a literal textual form should be avoided, as spammers continue to collect the addresses of their victims by scanning webpages for patterns in the text that match an email address. Common solutions use images or Javascript to print the address on the page, but they too are vulnerable to interpretation by the wrong interpretor.

What ’s in an address?

The email address may include the actual name of the recipient, whether a person or other entity. This is used by some email programs as display text in the address field, both in the sender's composition window and on the virtual enveloppe the receiver's side. The syntax is mailto:name<email> with the name between protocol and address, and < (less than) and > (greater than) delimiting the actual email (with its usual syntax a@b.c complete). And since we 're in a href attribute of a normal HTML element, they are to be escaped into &lt; and &gt; respectively to pass validation. Spaces and special characters in the name are possible, provided they are properly escaped; spaces before or after the name are also possible, but forbidden—or strongly discouraged. Some examples follow.

Parameters

Besides the address of the recipient, some extra information can be passed along, by appending a ? (question mark) to the address, followed by name/value pairs of one or more of the following parameters, each joined by an = (equals), and all separated by an & (ampersand), depending on doctype escaped to &amp;. The names are case-insensitive, meaning that you are free to write Subject or SUBJECT, if you prefer to do so.
NameDescription
subjectA title for the message.
ccCopy recipients. One or more addresses, separated by ; (semicolon).
bccBlind copy recipients. One or more addresses, separated by ;.
bodyThe actual message. Text or escaped HTML.
The items may be put in any order. The total length of the href value is bound to a limit, but this depends on too many things to even estimate, but after a certain unreasonable amount characters will be ignored, or error messages appear. In Outlook Express, perhaps the most used Microsoft email client, the maximum length is said to be 456 characters.
Special characters need special encoding. A space becomes %20. A new line is %0d%0a, preceded by a carriage return.
According to rumours, some browsers use the value of the title attribute of the <a> element as a subject for the e-mail message, but this has not been verified.

Some samples

Clicking any of the following links should open an email window with some of the fields pre-filled.
  1. Email
  2. Email with name to Ann Example
  3. Email with subject
  4. Email with CC and BCC
  5. Email with body

The HTML

  1. <li><a href="mailto:an@example.com">Email</a></li>
  2. <li>
  3.  <a href="mailto:Ann%20Example&lt;an@example.com&gt;title="Email to Ann.">
  4.   Email with name
  5.  </a>
  6.  to Ann Example
  7. </li>
  8. <li>
  9.  <a href="mailto:an@example.com?subject=About%20last%20night">
  10.   Email with subject
  11.  </a>
  12. </li>
  13. <li>
  14.  <a href="mailto:an@example.com?cc=Copy1&lt;copy1@example.com&gt;;copy2@example.com&bcc=blind@example.com">
  15.   Email with CC and BCC
  16.  </a>
  17. </li>
  18. <li>
  19.  <a href="mailto:an@example.com?subject=About%20the%20body&body=Escape%20%22special%20characters%20and%0d%0anew%20lines.">
  20.   Email with body
  21.  </a>
  22. </li>

Facebook PHP SDK Git Hub


PHP
We have created a new repository for this project: https://github.com/facebook/facebook-php-sdk. Please update anything you have pointing at this repostory to this location before April 1, 2012.
Read-Only access
 Latest commit to the deprecated branch
 readme.md
We have created a new repository for this project: https://github.com/facebook/facebook-php-sdk. Please update anything you have pointing at this repostory to this location before April 1, 2012.

Facebook PHP SDK (v.3.1.1)

The Facebook Platform is a set of APIs that make your app more social
This repository contains the open source PHP SDK that allows you to access Facebook Platform from your PHP app. Except as otherwise noted, the Facebook PHP SDK is licensed under the Apache Licence, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)

Usage

The examples are a good place to start. The minimal you'll need to have is:
require 'facebook-php-sdk/src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => 'YOUR_APP_ID',
  'secret' => 'YOUR_APP_SECRET',
));

// Get User ID
$user = $facebook->getUser();
To make API calls:
if ($user) {
  try {
    // Proceed knowing you have a logged in user who's authenticated.
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}
Login or logout url will be needed depending on current user state.
if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();
}

Tests

In order to keep us nimble and allow us to bring you new functionality, without compromising on stability, we have ensured full test coverage of the SDK. We are including this in the open source repository to assure you of our commitment to quality, but also with the hopes that you will contribute back to help keep it stable. The easiest way to do so is to file bugs and include a test case.
The tests can be executed by using this command from the base directory:
phpunit --stderr --bootstrap tests/bootstrap.php tests/tests.php

Growing Quality Apps with Open Graph


Henry Zhang

Growing Quality Apps with Open Graph

By Henry Zhang - Yesterday at 12:00am
Update: To clarify, the majority of custom actions will continue to be approved and function as normal. The changes announced below only impact custom actions for apps that publish stories as content is consumed. For example, if you have an app that publishes a "view" action to timeline and news feed each time some looks at videos on your site, you must migrate to the appropriate built-in action - "watch" - to provide a consistent user experience. For more information on what is considered a content consumption action please see the matrix in our Open Graph guidelines.
Over the past six months we've launched new channels, such as App Center with our improved recommendations engine, to drive distribution to the highest quality apps. As part of these ongoing updates, today we're releasing improvements to how we present Open Graph stories in news feed and on timeline to drive growth and engagement to your app.
In order to provide users with experiences that meet their expectations, we will no longer approve custom actions that publish stories as people consume content. These apps must use the appropriate built-in actions or create a different sharing experience. We are also deprecating a handful of features that led to low quality user experiences.
Our goal is to help you build quality apps that people will love. On average, Open Graph stories now have 50% higher click through rates than similar stories published using non-Open Graph API’s (stream.publish). To help you build great Open Graph apps, we are also releasing new Open Graph guidelines and clarifying our Platform Policies to better reflect our expectations.
Additional distribution from news feed and timeline
We've found stories with image and location to be among the most engaging, and so we’re making them more prominent in news feed and on timeline.
In early tests, the new image-led stories have shown 70% more clicks for apps that provide high quality, relevant imagery with low spam rates. In certain cases, we have seen these stories generate up to 50x more Likes than equivalent story types from before. The new location stories provide double-digit gains in distribution to apps.
By using Open Graph, you can benefit from all the improvements in news feed and timeline to drive better distribution to your app. Comparable stories published using non-Open Graph API's, such as stream.publish, will continue to be presented in the old format.
News Feed story generated by a non-Open Graph posting with location specified
Larger News Feed story layout generated by an Open Graph post usingLocation Tagging
To take advantage of these changes, incorporate relevant images and location tags with your Open Graph actions. For more information, please see our documentation on distribution.
Deprecating features that lead to low quality user experiences
Apps that help people automatically share stories about content as they consume it, such as the music you are listening to, can be good experiences when apps create clear expectations for the user of what is being shared and when. When apps automatically publish stories on a person’s behalf in a way that is unexpected, such as when they browse an online store, it can surprise and confuse people.
Starting today, custom actions that automatically publish back to Facebook as a person consumes content in your app will no longer be approved. We will only allow apps that use our built-in actions to automatically publish stories as content is consumed. With built-in actions, we understand the structure of the information and can ensure a better user experience by specializing story formats that can help set user expectations. Apps that currently use a custom content consumption action must migrate to use an applicable built-in action in the next 90 days. If you cannot find an applicable built-in, we encourage you to build a different experience that helps people share meaningful stories with friends on Facebook.
Additionally, we are deprecating the following features, which user feedback has shown to lead to low quality user experiences.
  • Authenticated referrals create an inconsistent experience for people by asking them to give permissions in order to access content with little context. You must migrate to use a standard Auth Dialog experience.
  • Post to friends wall via the API generate a high levels of negative user feedback, including “Hides” and “Mark as Spam" and so we are removing it from the API. If you want to allow people to post to their friend’s timeline from your app, you can invoke the feed dialog. Stories that include friends via user mentions tagging or action tagging will show up on the friend’s timeline (assuming the friend approves the tag).
Apps that currently use custom content consumption actions, Authenticated referrals, or post to friends wall via the APImust migrate to an alternative in the next 90 days. We have updated the Platform Roadmap to reflect this change.
Clear guidance
More information on building high quality apps can be found in the new Open Graph guidelines, including our views on quality and the attributes we look for when evaluating your submission.
We have also updated our Platform Policies (section III.A.6.) to make clear that you are responsible for providing users with a quality experience and must not confuse, defraud, mislead, spam or surprise users.
We’re excited by the increased quality of apps we are seeing and look forward to helping you grow.