SIMULATION -
The following is a series of questions in which you are required to input one or more lines of code.
To input your response -
Type your response into the text entry field in the Answer Area. You may input one or more lines of code. More than one solution may be correct. You will receive credit if your solution matches any of the correct solutions.
To validate code syntax -
After entering your code, click the Check Syntax button. This validates code syntax (such as SQL commands) and values (such as table names and variable names) used in your solution. If there are any errors, they will appear in the window next to the Check Syntax button. You may change your code and re-validate the syntax as many times as you want.
Note that Check Syntax does NOT validate whether you have answered the question correctly. It simply validates the accuracy of your syntax.
To view available command keywords
Click the Keywords button to view a list of command keywords. This is a general list provided for reference and is not limited to commands used in the question.
The Sales schema of a database contains the tables shown in the exhibit.
You need to create a stored procedure named RecentOrders that meets the following requirements:
✑ Declares an input variable named @EndDate of type varchar(255).
✑ Compare the value of @EndDate with the OrderDate for records from the Sales.Orders table.
✑ Return only the OrderID column for rows where the OrderDate is more recent than @EndDate.
Construct the Transact-SQL for the stored procedure by using the following guidelines:
✑ Do not use aliases.
✑ Do not use object delimiters.
✑ Ensure that any objects called in RecentOrders can be resolved by all users.
✑ Convert @endDate to a datetime data type in the WHERE clause of the SELECT statement before comparing the value to an OrderDate.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the Transact-SQL in the answer area that resolves the problem and meets the stated goals or requirements. You can add Transact-SQL within the Transact-SQL segment that has been provided as well as below it.
lilupv
4 years, 8 months ago