Q. Given the following table:

TABLE: LIBRARY

 
 
 
No Title Author Type Pub Qty Price
1. Data Structure Lipschutz DS McGraw 4 217
2. Computer Studies French FND Galgotia 2 75
3. Advanced Pascal Schildt PROG McGraw 4 350
4. Dbase dummies Palmer DBMS PustakM 5 130
5. Mastering C++ Gurewich PROG BPB 3 295
6. Guide Network Freed NET ZPress 3 200
7. Mastering Foxpro Seigal DBMS BPB 2 135
8. DOS guide Norton OS PHI 3 175
9. Basic for beginners Morton PROG BPB 3 40
10. Mastering Window Cowart OS BPB 1 225

Give the output of following SQL commands on the basis of table Library.

(i) SELECT UPPER (Title) FROM Library WHERE Price < 150;

(ii) SELECT CONCAT (Author, Type) FROM Library WHERE Qty <3;

(iii) SELECT MOD (Qty, 4) FROM Library;


Answer =


(i)

Output:-

 
UPPER (Title)
COMPUTER STUDIES
DBASE DUMMIES
MASTERING FOXPRO
BASIC FOR BEGINNERS

(ii)

Output:-

 
CONCAT (Author, Type)
FrenchFND
SeigalDBMS
CowartOS

(iii)

Output:-

 
MOD (Qty, 4)
0
2
0
1
3
3
2
3
3
1

7 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Part (iii) is incorrect, the order of MOD(Qty,4) answer will be 0,2,0,1,3,3,2,3,3,1

    ReplyDelete
    Replies
    1. Yes I agree with ur ans because mod will give remainder as answer

      Delete
  2. How did you get 4 mod 3 =3 when The answer should be 1.3 in part iii. Can you please explain

    ReplyDelete
    Replies
    1. MOD (Qty, 4) it will return the remainder when you divide Qty by 4. So, When you divide 3 by 4 then remainder is 3.

      Delete
  3. explain 3question

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post