0% found this document useful (0 votes)
3 views

MySQL Case based Questions GRADE 12

MySQL Case based Questions GRADE 12

Uploaded by

shobhit040212
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

MySQL Case based Questions GRADE 12

MySQL Case based Questions GRADE 12

Uploaded by

shobhit040212
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Table: TECH_COURSE

CID CNAME FEES STARTDATE TID


C201 Animation and VFX 12000 2022-07-02 101
C202 CADD 15000 2021-11-15 NULL
C203 DCA 10000 20220-10-01 102
C204 DDTP 9000 2021-09-15 104
C205 Mobile Application Development 18000 2022-11-01 101
C206 Digital Marketing 16000 2022-07-25 103
A. SELECT DISTINCT TID FROM TECH_COURSE;
B. SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE
GROUP BY TID HAVING COUNT(TID)>1;
C. SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER
BY CNAME;

D. SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES


BETWEEN 15000 AND17000;
3 Consider the table Hospital given below showing information of patients. Write
commands in MySQL for (i) to (iii)

i. To show all information of patients who are in Orthopedic department from


hospital table in descending order of their age.
ii. Increase the charges of male patient in ENT department by 4%.
iii. Display a report listing name, age, charges and amount. Amount is charges +
VAT as 2% on charges, name the column as total charges
4 “XYZ” Company conducts workshops for employees of organizations. The
company requires data of workshops that are organized. As a database
administrator you have decided that:
Name of the Database: ABCINC

52
Name of the Table: WORKSHOP
Attributes of Table ‘Workshop’ are as follows:

Table : WORKSHOP
WorkshopId Title DateWorkshop NumSpeakers

1001 Robotics 2020-03-21 3

1002 AI 2020-05-24 4

1003 Humanoids 2020-07-15 3

1004 Block Chain 2020-04-25 5

1005 Cloud 2020-03-03 4

a. Identify the attribute best suited to be declared Primary Key


b. Write a command to display details of workshop whose Title ends with letter s.
c. Write SQL command to update/modify the Number of Speakers from 3 to 4 for
Humanoids Workshop.
d. Write SQL command to display details of workshops to be conducted in 3rd
month (march).
5 Consider the below mentioned table of ‘CLOTH’
Write the SQL commands for the following:
a. Display first three letters of all values in DESCRIPTION column e.g. ‘FRO’
for ‘FROCK’
b. Display number of cloths of each Fabric.
c. Display average price of cloths of each Fabric.
6 Write suitable SQL query for the following: (5
A. Display 4 characters extracted from 3rd character onwards from string
“IMPOSSIBLE‟.
B. Display the position of occurrence of string “GO‟ in the string “LET‟s GO to
GOA”.
C. Round off the value 257.75 to nearest ten rupees.

53

You might also like