MySQL Question Bank
MySQL Question Bank
5) Which command is used in SQL to discard the changes done in the database recently?
9) While creating the table Book, Ms. Manasvi forgot to include two fields author and
12) What is the difference between Column constraints and Table constraints?
15) Explain the Primary Key, Candidate Key and Alternate key through an Example.
16) Explain the Concept of Primary key and Foreign Key using suitable example
18) Write a SQL statement to display the current date and time.
i. Display NAME of all doctors who are in “MEDICINE” having more than 10 years experience from the
table DOCTOR.
ii. Display the average salary of all doctors working in “ENT” department using the tables DOCTOR and
SALARY. Salary = BASIC + ALLOWANCE
iii. Display Name and Department Female doctors with more than 5 years of experience.
iv. Display the highest consultation fee among all male doctors.
v. SELECT count( * ) from DOCTOR where SEX “F”
vi. SELECT NAME from DOCTOR where DEPT LIKE “OR%” and NAME LIKE “S%‟
25. Consider the following tables Stationery and Consumer :
Table: Stationary
St_ID StationeryName Company Price
DP01 Dot Pen ABC 10
PL02 Pencil XYZ 6
ER05 Eraser XYZ 7
PL01 Pencil CAM 5
GP02 Gel Pen ABC 15
Table: Consumer
Cust_ID ConsumerName Address S_ID
01 Good Learner Delhi PL01
06 Write Well Mumbai GP02
12 Topper Delhi DP01
15 Write & Draw Delhi PL02
16 Motivation Banglore PL01