This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROCEDURE Days_Between (dStartDate IN date, | |
dEndDate IN date, | |
nGPA IN OUT number, | |
nDaysBetween OUT number) | |
<procedure declarations and body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @a = dbo.Func1(@param1, @param2, @param3 + 1, @param4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DaysBetween (dStartDate => dEnrolledDate, | |
dEndDate => dGraduationDate, | |
nGPA => nFinalGPA, | |
nDaysBetween => nDuration); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT | |
p.name AS product, | |
p.listprice AS 'List Price', | |
p.discount AS 'discount' | |
FROM production.product p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM job_history jh | |
WHERE employee_id = (SELECT employee_id | |
FROM employee e | |
WHERE jh.employee_id = e.employee_id | |
AND start_date = (SELECT Min(start_date) | |
FROM job_history jh | |
WHERE jh.employee_id = e.employee_id) | |
AND 5 > (SELECT Count( * ) | |
FROM job_history jh | |
WHERE jh.employee_id = e.employee_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vFirstName := 'Roger'; | |
vLastName := 'Smith'; | |
vSSN := 999999999; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM dual | |
WHERE 1=-1 | |
AND(1!=2 | |
OR 2^=3) | |
AND 3<>4 | |
AND 4>5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE FUNCTION sales.Fn_salesbystore | |
(@storeid INT) | |
RETURNS TABLE | |
AS | |
RETURN 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT (( ( a - b ) - c )) | |
FROM t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT last_name | |
FROM employees | |
WHERE salary > (SELECT salary | |
FROM employees | |
WHERE last_name = 'Abel'); |