mysql - How would I right a select statement to query this database? -


how right select statement if wanted find out how many people first name "jim" have passed test?

also if wanted instructor forename , surname, client forename , surname , date every test after 9:00 on 10/03/2015?

here relational schema database.

client (clientno, forename, surname, gender, address, telno, prolicenceno)

instructor (instructorid, forename, surname, gender, address, telno, licenceno, carno)

car (carno, regno, model)

lesson (clientno, ondate, attime, instructorid)

test (clientno, ondate, attime, instructorid, centreid, status, reason)

centre (centreid, name, address)

primary keys in bold , foreign keys in italic. no foreign keys allowed null.

thanks! :)

try joining between client , test table like:

select c.forename, count(c.forname) client c inner join test t on c.clientno = t.clientno c.forename = 'jim' ,   t.status = 'pass' group c.forname 

Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

python - Specify path of savefig with pylab or matplotlib -

html - grunt SVG to webfont -