
CREATE TABLE author (
	aid INTEGER, 
	homepage TEXT, 
	name TEXT, 
	oid INTEGER, 
	PRIMARY KEY (aid)
)


CREATE TABLE cite (
	cited INTEGER, 
	citing INTEGER, 
	FOREIGN KEY(cited) REFERENCES publication (pid), 
	FOREIGN KEY(citing) REFERENCES publication (pid)
)


CREATE TABLE conference (
	cid INTEGER, 
	homepage TEXT, 
	name TEXT, 
	PRIMARY KEY (cid)
)


CREATE TABLE domain (
	did INTEGER, 
	name TEXT, 
	PRIMARY KEY (did)
)


CREATE TABLE domain_author (
	aid INTEGER, 
	did INTEGER, 
	PRIMARY KEY (did, aid), 
	FOREIGN KEY(did) REFERENCES domain (did), 
	FOREIGN KEY(aid) REFERENCES author (aid)
)


CREATE TABLE domain_conference (
	cid INTEGER, 
	did INTEGER, 
	PRIMARY KEY (did, cid), 
	FOREIGN KEY(did) REFERENCES domain (did), 
	FOREIGN KEY(cid) REFERENCES conference (cid)
)


CREATE TABLE domain_journal (
	did INTEGER, 
	jid INTEGER, 
	PRIMARY KEY (did, jid), 
	FOREIGN KEY(jid) REFERENCES journal (jid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)


CREATE TABLE domain_keyword (
	did INTEGER, 
	kid INTEGER, 
	PRIMARY KEY (did, kid), 
	FOREIGN KEY(kid) REFERENCES keyword (kid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)


CREATE TABLE domain_publication (
	did INTEGER, 
	pid INTEGER, 
	PRIMARY KEY (did, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)


CREATE TABLE journal (
	homepage TEXT, 
	jid INTEGER, 
	name TEXT, 
	PRIMARY KEY (jid)
)


CREATE TABLE keyword (
	keyword TEXT, 
	kid INTEGER, 
	PRIMARY KEY (kid)
)


CREATE TABLE organization (
	continent TEXT, 
	homepage TEXT, 
	name TEXT, 
	oid INTEGER, 
	PRIMARY KEY (oid)
)


CREATE TABLE publication (
	abstract TEXT, 
	cid TEXT, 
	citation_num INTEGER, 
	jid INTEGER, 
	pid INTEGER, 
	reference_num INTEGER, 
	title TEXT, 
	year INTEGER, 
	PRIMARY KEY (pid), 
	FOREIGN KEY(jid) REFERENCES journal (jid), 
	FOREIGN KEY(cid) REFERENCES conference (cid)
)


CREATE TABLE publication_keyword (
	pid INTEGER, 
	kid INTEGER, 
	PRIMARY KEY (kid, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(kid) REFERENCES keyword (kid)
)


CREATE TABLE writes (
	aid INTEGER, 
	pid INTEGER, 
	PRIMARY KEY (aid, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(aid) REFERENCES author (aid)
)

CREATE TABLE author (
	aid INTEGER, 
	homepage TEXT, 
	name TEXT, 
	oid INTEGER, 
	PRIMARY KEY (aid)
)

/*
2 rows from author table:
aid	homepage	name	oid

*/


CREATE TABLE cite (
	cited INTEGER, 
	citing INTEGER, 
	FOREIGN KEY(cited) REFERENCES publication (pid), 
	FOREIGN KEY(citing) REFERENCES publication (pid)
)

/*
2 rows from cite table:
cited	citing

*/


CREATE TABLE conference (
	cid INTEGER, 
	homepage TEXT, 
	name TEXT, 
	PRIMARY KEY (cid)
)

/*
2 rows from conference table:
cid	homepage	name

*/


CREATE TABLE domain (
	did INTEGER, 
	name TEXT, 
	PRIMARY KEY (did)
)

/*
2 rows from domain table:
did	name

*/


CREATE TABLE domain_author (
	aid INTEGER, 
	did INTEGER, 
	PRIMARY KEY (did, aid), 
	FOREIGN KEY(did) REFERENCES domain (did), 
	FOREIGN KEY(aid) REFERENCES author (aid)
)

/*
2 rows from domain_author table:
aid	did

*/


CREATE TABLE domain_conference (
	cid INTEGER, 
	did INTEGER, 
	PRIMARY KEY (did, cid), 
	FOREIGN KEY(did) REFERENCES domain (did), 
	FOREIGN KEY(cid) REFERENCES conference (cid)
)

/*
2 rows from domain_conference table:
cid	did

*/


CREATE TABLE domain_journal (
	did INTEGER, 
	jid INTEGER, 
	PRIMARY KEY (did, jid), 
	FOREIGN KEY(jid) REFERENCES journal (jid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)

/*
2 rows from domain_journal table:
did	jid

*/


CREATE TABLE domain_keyword (
	did INTEGER, 
	kid INTEGER, 
	PRIMARY KEY (did, kid), 
	FOREIGN KEY(kid) REFERENCES keyword (kid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)

/*
2 rows from domain_keyword table:
did	kid

*/


CREATE TABLE domain_publication (
	did INTEGER, 
	pid INTEGER, 
	PRIMARY KEY (did, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(did) REFERENCES domain (did)
)

/*
2 rows from domain_publication table:
did	pid

*/


CREATE TABLE journal (
	homepage TEXT, 
	jid INTEGER, 
	name TEXT, 
	PRIMARY KEY (jid)
)

/*
2 rows from journal table:
homepage	jid	name

*/


CREATE TABLE keyword (
	keyword TEXT, 
	kid INTEGER, 
	PRIMARY KEY (kid)
)

/*
2 rows from keyword table:
keyword	kid

*/


CREATE TABLE organization (
	continent TEXT, 
	homepage TEXT, 
	name TEXT, 
	oid INTEGER, 
	PRIMARY KEY (oid)
)

/*
2 rows from organization table:
continent	homepage	name	oid

*/


CREATE TABLE publication (
	abstract TEXT, 
	cid TEXT, 
	citation_num INTEGER, 
	jid INTEGER, 
	pid INTEGER, 
	reference_num INTEGER, 
	title TEXT, 
	year INTEGER, 
	PRIMARY KEY (pid), 
	FOREIGN KEY(jid) REFERENCES journal (jid), 
	FOREIGN KEY(cid) REFERENCES conference (cid)
)

/*
2 rows from publication table:
abstract	cid	citation_num	jid	pid	reference_num	title	year

*/


CREATE TABLE publication_keyword (
	pid INTEGER, 
	kid INTEGER, 
	PRIMARY KEY (kid, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(kid) REFERENCES keyword (kid)
)

/*
2 rows from publication_keyword table:
pid	kid

*/


CREATE TABLE writes (
	aid INTEGER, 
	pid INTEGER, 
	PRIMARY KEY (aid, pid), 
	FOREIGN KEY(pid) REFERENCES publication (pid), 
	FOREIGN KEY(aid) REFERENCES author (aid)
)

/*
2 rows from writes table:
aid	pid

*/
return me the number of journals which have papers by " H. V. Jagadish " .
SELECT COUNT ( DISTINCT t2.name ) FROM publication AS t4 JOIN journal AS t2 ON t4.jid  =  t2.jid JOIN writes AS t3 ON t3.pid  =  t4.pid JOIN author AS t1 ON t3.aid  =  t1.aid WHERE t1.name  =  "H. V. Jagadish";
[{'COUNT ( DISTINCT t2.name )': 0}]