Tables and Errors: Zawiyar Ahmad 181340
Tables and Errors: Zawiyar Ahmad 181340
Tables and Errors: Zawiyar Ahmad 181340
181340
BONUS TABLE
CREATE TABLE Bonus (
WORKER_REF_ID INT Primary key identity(1,1),
BONUS_AMOUNT INT,
BONUS_DATE DATETIME,
WORKER_ID INT FOREIGN KEY REFERENCES Worker (WORKER_ID)
);
INSERT INTO Bonus
( BONUS_AMOUNT, BONUS_DATE,WORKER_ID)
VALUES( 5000, '2016-02-20',1)
TABLE TITLE
QUERIES
1. SELECT GETDATE()
2. SELECT FIRST_NAME AS WORKER_NAME FROM WORKER
WORKER_NAME
3. SELECT UPPER(FIRST_NAME) FROM Worker
4. select distinct DEPARTMENT FROM Worker
5. SELECT SUBSTRING(FIRST_NAME,1,3)FROM Worker
6. SELECT DEPARTMENT, LENGTH(DEPARTMENT) 'Length of
DEPARTMENT' FROM Worker;
7. SELECT *FROM Worker ORDER BY FIRST_NAME
8. SELECT *FROM Worker ORDER BY FIRST_NAME
9. SELECT *FROM Worker WHERE FIRST_NAME='Saood'and
LAST_NAME='Hashim'
10. SELECT *FROM Worker WHERE DEPARTMENT='Admin'
11. SELECT *FROM Worker WHERE FIRST_NAME LIKE '%a%'
12. SELECT *FROM Worker WHERE FIRST_NAME LIKE '%__a%'
13. SELECT FIRST_NAME FROM Worker WHERE
length(FIRST_NAME) = 5 and FIRST_NAME like '%h';