Professional Documents
Culture Documents
Select From Garment Where Size 'XL'
Select From Garment Where Size 'XL'
(ii)
(iii)
(iv)
UPDATE GARMENT
PAGE : 02
1. Create the table named ‘GARMENT’. Write command of SQL for (i) to (iv).
(i) To display names of those garments that are available in ‘XL’ size.
(ii) To display codes and names of those garments that have their names starting with ‘Ladies’.
(iii) To display codes and names, codes, and prices of those garments that have price in the range 1000.00 to
1500.00.
TABLE :
GNAME VARCHAR(20),
SIZE VARCHAR(10),
COLOUR VARCHAR(10),
PRICE DEC(6,2) );
VALUES
PAGE : 01
PAGE : 01
(i)
(ii)
(iii)
PAGE : 04
2. Consider the following table named ‘SOFTDRINK’. Write commands of SQL for :
(i) To display names and drink codes of those drinks that have more than 120 calories.
(ii) To display drink codes, names and calories of all drinks, in descending order of calories.
(iii) To display names and prices of drinks that have prices in the range 12 to 18 (both included).
(iv) Increase the price of all drinks in the given table by 10%.
TABLE :
DNAME VARCHAR(20),
PRICE DEC(4,2),
CALORIES INT );
VALUES
PAGE : 03
POSTING :
DEPARTMENT VARCHAR(20),
PLACE VARCHAR(20) );
VALUES
(i)
(ii)
PAGE : 06
PAGE : 06
(iii)
ORDER BY Date_of_join ;
(iv)
(v)
PAGE : 07
3. Write SQL commands for following queries (i) to (v) based on the relations Teacher and Posting given :
(ii) To list all the names of female teachers who are in Mathematics department.
(iii) To list the names of all the teachers with their date of joining in ascending order.
(iv) To display teacher’s name, salary, age for male teachers only.
(v) To display name, bonus for each teacher where bonus is 10% of salary.
STUDENT :
NAME VARCHAR(20),
AGE INT,
DEPARTMENT VARCHAR(20),
DATE_OF_JOIN VARCHAR(20),
SALARY INT,
GENDER VARCHAR(1) );
VALUES
PAGE : 05
PAGE : 05