Table: student
| Roll | Name | Hostel | Marks |
|---|---|---|---|
| 1798 | Manoj Rathod | 7 | 95 |
| 2154 | Soumic Banerjee | 5 | 68 |
| 2369 | Gumma Reddy | 7 | 86 |
| 2581 | Pradeep Pendse | 6 | 92 |
| 2643 | Suhas Kulkarni | 5 | 78 |
| 2711 | Nitin Kadam | 8 | 72 |
| 2872 | Kiran Vora | 5 | 92 |
| 2926 | Manoj Kunkalikar |
5 | 94 |
| 2959 | Hemant Karkhanis |
7 | 88 |
| 3125 | Rajesh Doshi | 5 | 82 |
Table: hobby
| Roll | Hobbyname |
|---|---|
| 1798 | chess |
| 1798 | music |
| 2154 | music |
| 2369 | swimming |
| 2581 | cricket |
| 2643 | chess |
| 2643 | hockey |
| 2711 | volleyball |
| 2872 | football |
| 2926 | cricket |
| 2959 | photography |
| 3125 | music |
| 3125 | chess |
The following SQL query is executed on the above tables:
Select hostel
From student natural join hobby
Where marks > = 75 and roll between 2000 and 3000;
Relations S and H with the same schema as those of these two tables respectively contain the same information as tuples. A new relation S’ is obtained by the following relational algebra operation:
$$\eqalign{ & S' = \prod\nolimits_{hostel} {(({\sigma _{S.roll = H.roll}}} \cr & ({\sigma _{marks > 75\,\,\,and\,\,roll > 2000\,\,and\,\,roll < 3000}}(S))X(H)) \cr} $$The difference between the number of rows output by the SQL statement and the number of tuples in S’ is
A company maintains records of sales made by its salespersons and pays them commission based on each individual’s total sales made in a year. This data is maintained in a table with following schema:
salesinfo = (salespersonid, totalsales, commission)In a certain year, due to better business results, the company decides to further reward its salespersons by enhancing the commission paid to them as per the following formula:
If commission < = 50000, enhance it by 2%
If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%
The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of these scripts is to run as a separate transaction as follows:
T1: Update salesinfo
Set commission = commission * 1.02
Where commission < = 50000;
T2: Update salesinfo
Set commission = commission * 1.04
Where commission > 50000 and commission is < = 100000;
T3: Update salesinfo
Set commission = commission * 1.06
Where commission > 100000;
Which of the following options of running these transactions will update the commission of all salespersons correctly?Select title
From book as B
Where (select count(*)
From book as T
Where T.price > B.price) < 5;Supply = (supplierid, itemcode)
Inventory = (itemcode, warehouse, stocklevel)
For a specific information required by the management, following SQL query has been written
Select distinct STMP.supplierid
From Supply as STMP
Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP
Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode
And Inventory.warehouse = 'Nagpur');
For the warehouse at Nagpur, this query will find all suppliers whoGATE CSE Papers
All year-wise previous year question papers