MYSQL
MYSQL
TABLE: BANK
AIM: To understand the use of mysql database management system using table
bank.
To display the details about all the Fixed Deposits whose interest rate is
notentered
To display the Account number and FD amount of all the Fixed Deposits that are
started before 01-04-2018
To display the customer name and FD amount for all the Fixed deposits which
donot have a number of months as 36.
To display the customer name and FD Amount of all the Fixed deposits forwhich
the FD amount is less than 500000 and int_rate is more than 7.
To display the details of all the Fixed Deposits whose FD Amount is in therange
40000-50000
.To display the Customer name and FD amount for all the loans for which
thenumber of months is 24,36 or 48(using in operator)
. To display the Account number, customer name and fd_amount for all the FDs
for which the customer name ends with “Sharma”;
To display the average FD amount. Label the column as “Average FD Amount”
To display the total FD amount which started in the year 2018.
To display the details about all the FDs whose rate of interest is not in the
range 6% to 7%
To display the details about all the FDs whose customer name doesn’t contain the
character “a”.
.To update the Interest rate of all the bank Customers from 6.75 to 6.80
update banks set int_rate =6.80 where int_rate = 6.75;
TABLE: CLUB
AIM :
1.To show all information about the Swimming coaches in the Club
2.To list the names of all coaches with their date of appointment in descending
order.
select sports ,min(pay),max(pay),avg(pay) from club group by sports;
To display coachname, pay ,age and bonus(15% of pay)
.To display the distinct sports from the club.
.To display the details about the female coaches in the club
To display the coachnames, sports , pay and date_of_app of all the coaches whose
name ends with “n”.
To display the coachname, sports ,age and pay of all the coaches whose pay is in
the range 2000-2500
.To display the details about all the coaches who are above 30 in age and coach a
sport starting with the letter “s”.
To display the number of coaches available for every sports.
To display the average Pay given for a coach for every sports activity.
To display the details about all the male coaches who joined after 15 th February
1998. select * from club where sex="M" and date_of_app >"1998-02-15";
To display the coach id , names and age of all the coaches who coach neither
Swimming nor Basketball
To display the names of all the sports in the club which have more than 2 coaches.
To display the total salary given for male and female coaches in the club.
TABLE: HOSPITAL
AIM:
1.To show all the information about the patients of the cardiology department.
To list the names of female patients who are either in the orthopaedic or surgery
department.
To display various departments in the hospital.
.To display the number of patients in each department.
.To display details of all the patients whose name’s second character is “a”.
To display the details of all the patients who was admitted in the year 2019.
.To display the details about all the patients in the reverse alphabetical order of
their names.
.To display the average charges collected in every department.
To display the patient detail whose age is missing.
.To display the names of the patients who are charged in the range 300 and
400(both inclusive)
To display the number of patients who are aged above 30.
.To display the names of the department and the number of patients in the
department that have more than one patient.
To delete the record of the patient “Kush”.
To decrease the charges by 5% of all the patients admitted to the ENT department.
To add another column DOCNAME of datatype varchar(20) into the table hospital.
TABLE: ITEMS
TABLE : TRADERS
AIM:
To manipulate the tables ITEMS and TRADERS using MySQL Queries
MySQL QUERIES:
1.To display the natural join of the tables items and traders.
TABLE: ITEMS
TABLE : TRADERS
AIM:
To manipulate the tables ITEMS and TRADERS using MySQL Queries
MySQL QUERIES:
1.To display the natural join of the tables items and traders.
To display the number of items traded by every Trader.
.To display the Itemname, company, tradername and city of all the items
.To display the Item name and Trader name of all the items that are either from
Delhi or Mumbai
To display the minimum and maximum price of the item traded by every trader.
.To display the average price of an item traded by every trader.
To display the Itemname and trader name of all the items in the alphabetical order
of the itemnames.
To display the names of the traders whose average price of an item is not more
than 20000.
.To display the details about all the items whose price is in the range
To display the total number of quantity of items available for every trader.
PROGRAM NO 25
TABLE: WORKER
TABLE:DEPT
AIM:
To manipulate the table WORKER and DEPT using MySQL Queries.