Question 1 DBMS Placements and SQL Practice
For Complete YouTube Video: Click Here
We will try to solve Question 1 DBMS Placements and SQL Practice, in this class.
The Database Management Systems DBMS is the prerequisite course to understand the concepts we discuss.
These kinds of questions are frequently asked in the campus placement’s written tests. All these questions are asked in service-based companies like Wipro, Infosys, CTS, TCS, Accenture, IBM, and many more service-based companies.
Question 1 DBMS Placements and SQL Practice
custno | accountno | ifsccode | location | amount | accounttype |
C301 | 10530002231 | BANK0001053 | Mysore | 140000 | Savings |
C302 | 12340004235 | BANK0001234 | Delhi | 225000 | Current |
C303 | 87900002367 | BANK0008790 | Bangalore | 79000 | Savings |
C304 | 56630003454 | BANK0005663 | Bangalore | 152000 | Current |
C305 | 78390002343 | BANK0007839 | Delhi | 73000 | Savings |
A, B are given the requirements to retrieve account details and sort details according to location (alphabetically) and in decreasing order of the amount in each account of that location.
A’s Query
SELECT custno, accountno, ifsccode, location, amount, accounttype FROM account ORDER BY location ASC, amount DESC;
B’s Query
SELECT custno, accountno, ifsccode, location, amount, accounttype FROM account ORDER BY 5 DESC, 4 ASC;
Whose query will be correct to satisfy the above requirement?
- Neither A nor B
- Both A and B
- Only B
- Only A
A detailed explanation of the above question is made in the above youtube link.