I have a basic grasp of SQL and now need to apply it to more complex examples with multiple tables.
Problem 1 is I am not sure I fully understand the client request, I think I do but I am not sure. I know you can't really help me here but I figure once you have done this a while, many client requests resemble each other.
Problem 2, is my query correct, I am at home and cannot test it right now.
Plumbing company wants to manage its contracts for heating and water heaters.
Tables
Clients(CliNum, CliLastName, CliFirstName, CliAddress)
Contracts(ContNum, CliNum*, AppCat)
Intervention_Contract(IntContNum, ContNum*, IntContDate, IntContduration)
I need to write a query to fetch a list of interventions, their duration, concerning a specific appliance category X.
SELECT Intervention_Contract.IntComNum, Intervention_Contract.IntContDuration, Contracts.AppCat
WHERE Intervention_Contract.ContNum=Contracts.ContNum
For a specific appliance catergory, we'll say X, do I then put it in parentheses?
Like
Contracts.AppCat(X)
Thanks for any help.
PS, I know I can create a few databases locally to practice my queries but I find it helpful to use data that I don't know well. I tend to make simple tables and simple data for my examples, but when querying more complex databases I find it is more helpful to use data you did not create and are not as familiar with. Does anyone know of a website with a couple of databases already generated where i can practice more complex queries across multiple tables?
Problem 1 is I am not sure I fully understand the client request, I think I do but I am not sure. I know you can't really help me here but I figure once you have done this a while, many client requests resemble each other.
Problem 2, is my query correct, I am at home and cannot test it right now.
Plumbing company wants to manage its contracts for heating and water heaters.
Tables
Clients(CliNum, CliLastName, CliFirstName, CliAddress)
Contracts(ContNum, CliNum*, AppCat)
Intervention_Contract(IntContNum, ContNum*, IntContDate, IntContduration)
I need to write a query to fetch a list of interventions, their duration, concerning a specific appliance category X.
SELECT Intervention_Contract.IntComNum, Intervention_Contract.IntContDuration, Contracts.AppCat
WHERE Intervention_Contract.ContNum=Contracts.ContNum
For a specific appliance catergory, we'll say X, do I then put it in parentheses?
Like
Contracts.AppCat(X)
Thanks for any help.
PS, I know I can create a few databases locally to practice my queries but I find it helpful to use data that I don't know well. I tend to make simple tables and simple data for my examples, but when querying more complex databases I find it is more helpful to use data you did not create and are not as familiar with. Does anyone know of a website with a couple of databases already generated where i can practice more complex queries across multiple tables?