Page 42 - IP
P. 42

Help him in writing SQL query for the following purpose:
                    i.   To count how many female candidates will be attending the training.
                    ii.  To display list of free trainings.
                    iii.  To display all the cities where Cyber Security training is scheduled along with
                         its fee.
                    iv.  To add a column feedback with suitable data type

                  Ans:   i. Select count(name) from training where name like ‘Ms.%’;
                          ii. Select * from training where fee is NULL;
                         iii. Select city, fee from training where topic = ‘Cyber Security’;
                        iv. Alter table training add feedback varchar(20);

                         (1  Mark for each correct query)

                  (c)   Observe the table named “Training” given above carefully and predict the output  4
                         of the  following queries:
                       i. select city from training where topic = 'Cyber Security';
                       ii. select count(Training_Id) from training where email_id like '%gmail% ';
                      iii. select AVG (Fee) from training where Topic = 'Cyber Security';
                      iv. select name from training where INSTR (Email_Id, '@’)=0;

                  Ans:   i. New Delhi
                           Faridabad
                           Gurugram
                         ii. 2
                         iii. 11000
                         iv. Ms. Neena

                         (1  Mark for each correct Output)

                  (d)      What is the degree and cardinality of the above given table named ‘Training’.   1

                  Ans:   Degree: 6
                         Cardinality: 5
                         (½ Mark for each correct answer)

          4.      (a)     Shiva has placed two radio button on a payment form designed in NetBeans to  1
                         accept mode of payment one out of cash or card. To his surprise, during runtime,
                         a customer is able to select both the options for a single transaction. What went
                         wrong?
                                                           OR
                         Mention any one advantage of jCheckBox control over jRadioButton control.

                  Ans:  Shiva has forgot to attach both the radio buttons to one button group to make
                         them mutually exclusive.

                                                           OR
                         Multiple options can be selected through jCheckBox control while jRadioButton
                         allows selecting a single option.

                          (1 Mark for correct answer)



                                                            5
   37   38   39   40   41   42   43   44   45   46   47