Question

What SQL syntax could you use to filter date ranges in your dataset?

What SQL syntax could you use to filter date ranges in your dataset?

Homework Answers

Answer #1

The syntax would be

SELECT * FROM TABLE WHERE DATE >= '*date*' AND DATE <= '*date*'

Let say the following is our data for reservations in a cruise.

Now, let say you need to find the reservations after today i.e 28th September. The SQL syntax would be

SELECT * FROM RESERVATION WHERE CruiseDate > '2019-09-28';

You get the results as

If you want the reservations from 15th August to today, the query would be

SELECT * FROM RESERVATION WHERE CruiseDate > '2019-08-15'AND CruiseDate <= '2019-09-28'; and the results,

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
What SQL syntax would you use to change data in a table if you only had...
What SQL syntax would you use to change data in a table if you only had read access to the table? Having read access means the data manipulation would occur in the dataset rather than in the table being pulled from.
What SQL syntax would you use to change data in a table if you only had...
What SQL syntax would you use to change data in a table if you only had read access to the table? Having read access means the data manipulation would occur in the dataset rather than in the table being pulled from.
Using SQL syntax, what statement would you use to create an Employee table with the information...
Using SQL syntax, what statement would you use to create an Employee table with the information FirstName, LastName, and EmployeeID.
What methodologies could you use to improve the performance of a SQL query?
What methodologies could you use to improve the performance of a SQL query?
Explain how you could use a single polarizing filter to detirmine whether light from a given...
Explain how you could use a single polarizing filter to detirmine whether light from a given source is polarized or unpolarized: what would you do with the filter? What would you see if the light was polarized vs unpolarized?
Describe how you could use a confidence interval to analyze a portion a dataset in a...
Describe how you could use a confidence interval to analyze a portion a dataset in a way that would help the owner of the restaurant better understand his customers. Be sure to use proper statistical terminology. You do not have to actually calculate the confidence interval
Describe how you could use a confidence interval to analyze a portion a dataset in a...
Describe how you could use a confidence interval to analyze a portion a dataset in a way that would help the owner of the restaurant better understand his customers. Be sure to use proper statistical terminology. You do not have to actually calculate the confidence interval
If the melting point ranges of your dimethone and dimethone anhydride derivatives were the same, what...
If the melting point ranges of your dimethone and dimethone anhydride derivatives were the same, what common analytical techniques (not including NMR or mass spectrometry) could you use to establish if the compounds were the same or different? List at least two techniques and state how they could be used to answer the question.
Research a SQL community and post the link in your discussion. Why did you choose this...
Research a SQL community and post the link in your discussion. Why did you choose this community? What could it help you with in your current career?
Use the built in R dataset called “mtcars.” You can see what variables this dataset contains...
Use the built in R dataset called “mtcars.” You can see what variables this dataset contains by typing help(mtcars). Calculate a scatter plot for the variables: wt and mpg. Also, calculate the correlation coefficient. Calculate a least squares line and plot it in the scatterplot.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT