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 department_id, | |
Min(salary) | |
FROM employees | |
GROUP BY department_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
CREATE TABLE datatype | |
(fld0 GENERICTYPE, | |
fld1 CHAR(2), | |
fld3 NCHAR(1)); |
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 dbo.isoweek (@DATE datetime) | |
RETURNS INT | |
WITH EXECUTE AS caller | |
AS | |
BEGIN | |
DECLARE @ISOweek INT | |
SET @ISOweek= datepart(wk,@DATE)+1 | |
-datepart(wk,CAST(datepart(yy,@DATE) AS CHAR(4))+'0104') |
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
-- | |
-- If the student's grade point average meets the criteria for | |
-- mandatory academic counseling, add the student's name and social | |
-- security number to the list. | |
-- | |
IF (nRealGPA < 1.5) THEN | |
<statements> | |
-- | |
-- We also want to consider students who are failing two or more |
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
-- | |
-- For each student returned by the query, add the student's social | |
-- security number to the PL/SQL table. | |
-- | |
FOR Students_rec IN Students_cur LOOP | |
<statements> | |
END LOOP; |
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
EXCEPTION | |
WHEN NO_DATA_FOUND THEN | |
<statements> | |
WHEN TOO_MANY_ROWS THEN | |
<statements> | |
WHEN OTHERS THEN | |
<statements> |
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 Update_Student_GPA (nSSN IN number) | |
IS | |
<declaration> | |
<declaration> | |
BEGIN | |
<statements>; | |
END Update_Student_GPA; |
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 Update_Student_GPA (nSSN IN number) | |
IS |
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 = @B | |
SET @C = @D | |
SET @E = @F | |
SET @G = @H |
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 ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER OFF | |
GO |