Professional Documents
Culture Documents
Small Questions
Small Questions
Small Questions
-INSERT INTO
-UPDATE
-ALTER
-SELECT
-WHERE
-ROLL BACK
-PRIMARY KEY
-FOREIGN KEY
-CHECK
-UNIQUE
-DEFAULT
3.Which of the following will not allow a field to take duplicate value and null value?
-PRIMARY KEY
-UNIQUE
NOT NULL
-FPOREIGN KEY
4.Which of the following will display unique value from a mentioned field?
-PRIMARY KEY
-UNIQUE
-ALL
-DISTINCT
5.Which of the following use wild card characters to match given pattern on a field to display
Records?
-BEWTEEN
-IN
-LIKE
-ORDER BY
-DELETE
-INSERT
-UPDATE
-ALL
-BETWEEN
-HAVING
-LIKE
-GROUP BY
-IN
-DISTINCT
9.Which of the following command is used with ALTER command to change the datatype of a field?
Which of the following command is used with ALTER command to rename a field?
Which of the following command is used with ALTER command to include a field in a table?
11.The output will contain all pair of tuples from two tables/relations in which of the following operation?
-Cartesian product
-Join
-Intersection
-Set difference
-All
Which of the following command is used to set condition for group of records/tuples?
13.Which of the following command is used to set condition for list of values specified?
-WHERE
-HAVING
-IN
LIKE
-BETWEEN
14.ITEM(NO.,ITEM_NAME,TYPE,DATE_STOCK,PRICE,DISCOUNT)
14(i)-show max, min price, total no. of items of each type of items from ITEM table
SELECT MAX(PRICE),MIN(PRICE),COUNT(*),TYPE
FROM ITEM
GROUP BY TYPE;
FROM ITEM
ITEM(NO.,ITEM_NAME,TYPE,DATE_STOCK,PRICE,DISCOUNT)
FROM ITEM;
SELECT MAX(EXP),MIN(EXP),COUNT(*),DEPARTMENT
FROM MEDICAL_OFFICER
GROUP BY DEPARTMENT;
SELECT COUNT(DISTINCT(GENDER))
SELECT *
FROM MEDICAL_OFFICER
(i) to change datatype of field E_Name from char(50) to varchar(70) in Employee table
(iii)to insert 3 records in WORKER table, the table is containing following specifications:
(W_ID char(10) , W_NAME varchar(70) , W_SAL integer ,W_DEPT char(20) , W_AREA varchar(80) , W_AGE integer)
(W_ID char(10) , W_NAME varchar(70) , W_SAL integer ,W_DEPT char(20) , W_AREA varchar(80) , W_AGE integer)
FROM Worker;
SHOW TABLES;
SHOW DATABASES;
DESC Student;
Or
DESCRIBE Student;
EMPLOYEE(E_ID,F_NAME,L_NAME,LOCATION,CITY)
POST(E_ID,E_SAL,E_BONUS,E_POST)
(i)to display first name, location of employees who are coming from ‘DELHI’ or ‘PUNE’ or ‘BENGALURU’
SELECT F_NAME,LOCATION
FROM EMPLOYEE
(ii)to display details of employee whose name starts with ‘A’ from EMPLOYEE table
SELECT *
FROM EMPLOYEE
(iii)to display max salary, min salary, max bonus, no. of employees of each department/post from
EMPLOYEE table
SELECT MAX(E_SAL),MIN(E_SAL),MAX(E_BONUS),COUNT(*),E_POST
FROM EMPLOYEE
GROUP BY E_POST;
CLOTHES(CODE,NAME,PRICE,LAUNCHDATE)
(i)to display details of clothes which was launched after 2005(assume that all launch dates are given with 2005,2006)
SELECT *
FROM CLOTHES
FROM CLOTHES;
(iii)to display all information of clothes in ascending order of name where price is more than 430 rupees
SELECT *
FROM CLOTHES
WHERE PRICE>430
DROP B_GROUP;