C05B – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  

Login
[lwa]



Q&A CBSE12A-2018-C05B #5738 siteicon  

Question:

Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables.
Table: ACCOUNT

ANO ANAME ADDRESS
101 Nirja Singh Bangalore
102 Rohan Gupta Chennai
103 Ali Reza Hyderabad
104 Rishabh Jain Chennai
105 Simran Kaur Chandigarh

Table: TRANSACT

TRNO ANO AMOUNT TYPE DOT
T001 101 2500 Withdraw 2017-12-21
T002 103 3000 Deposit 2017-06-01
T003 102 2000 Withdraw 2017-05-12
T004 103 1000 Deposit 2017-10-22
T005 101 12000 Deposit 2017-11-06

(i) To display details of all transactions of TYPE Deposit from Table TRANSACT.

(ii) To display the ANO and AMOUNT of all Deposits and Withdrawals done in the month of October 2017 from table TRANSACT.

(iii) To display the last date of transaction (DOT) from the table TRANSACT for the Accounts having ANO as 103.

(iv) To display all ANO, ANAME and DOT of those persons from tables ACCOUNT and TRANSACT who have done transactions less than or equal to 3000.

(v) SELECT ANO, ANAME FROM ACCOUNT
WHERE ADDRESS NOT IN (‘CHENNAI’, ‘BANGALORE’);

(vi) SELECT DISTINCT ANO FROM TRANSACT;

(vii) SELECT ANO, COUNT(*), MIN(AMOUNT) FROM TRANSACT
GROUP BY ANO HAVING COUNT(*)> 1;

(viii) SELECT COUNT(*), SUM(AMOUNT) FROM TRANSACT
WHERE DOT <= ‘2017-06-01’;

Answer:

(i) SELECT * FROM TRANSACT WHERE TYPE = ‘ Deposit ‘ ;

(ii) SELECT ANO,AMOUNT FROM TRANSACT
WHERE DOT >= ‘ 2017-10-01 ‘ AND DOT <= ‘ 2017-10-31 ‘ ;
OR
SELECT ANO,AMOUNT FROM TRANSACT
WHERE DOT BETWEEN ‘ 2017-10-01 ‘ AND ‘ 2017-10-31 ‘ ;

(iii) SELECT MAX(DOT) FROM TRANSACT WHERE ANO = 103;

(iv) SELECT ACCOUNT.ANO,ANAME,DOT FROM ACCOUNT,TRANSACT WHERE
ACCOUNT.ANO=TRANSACT.ANO AND AMOUNT <=3000;
OR
SELECT A.ANO,ANAME,DOT FROM ACCOUNT A,TRANSACT T WHERE
A.ANO=T.ANO AND AMOUNT <=3000;

(v)
ANO     ANAME
103       Ali Reza
105       Simran Kaur
OR
ANO     ANAME
101       Nirja Singh
102       Rohan Gupta
103       Ali Reza
104       Rishabh Jain
105       Simran Kaur

(vi)

DISTINCT ANO
101
102
103

(vii)
ANO     COUNT(*)      MIN(AMOUNT)
101           2                    2500
103           2                   1000

(Viii)
COUNT(*)       SUM(AMOUNT)
2                        5000


Share

CSKC| Created: 2-Jan-2019 | Updated: 4-Jan-2019|CBSE12A-2018






×
ssignment Introductory Sessions Beginning to Program Tokens Keyword and Identifiers Data Types Variables and Constants Operators Simple User Input Building Expressions and Formulas Simple Real World Problems Simple If and If Else Multiple-Nested-Ladder of If Else Switch case selection Simple Loops Tricks in Loops - break continue scope Loop Applications - Handling numerals Series printing loops Nested Loops Pattern printing loops Number Varieties and Crunches String Handling (Null Terminated) Strings - string class type Functions (Built-in) Functions - user defined Functions Reference Passing/Returning Arrays Concepts and 1-D Arrays Array Data Management Two dimensional arrays and Matrices Structures Basics Structures passing/returning 2D Array Memory Addressing Display Using IO Manipulation Display Using C Formatting Tricks User Defined Data Types Enumerated Types Preprocessor Directives And Macros Exception Handling Programming Paradigms and OOPs Advantages Abstraction and Encapsulation Polymorphism Inheritance Function Overloading Concepts Function Overloading Varieties Function Overloading Special Cases Defining Classes Creating and Using Class Objects Class Members Accessibility Class Function Types Inline Functions Constant Functions Nesting of Functions Class Members Scope Resolution Static Members in a Class Array of Objects Constructor Concepts Default Constructor Parameterized Constructor Copy Constructor Constructor Overloading Destructors Inheritance Fundamentals Public Derivations Private and Protected Derivations Multiple Inheritance Multi-Level Inheritance Class Nesting Data File Concepts Handling Text Files Handling Binary Files Pointer Concepts Pointer and Arrays Pointers and Functions Object Pointers This Pointer Linked Lists Stacks Queues Introductory Sessions Beginning to Program Tokens Keywords Identifiers Literals Data Types Variables and Constants Operators (Arithmetic-Assignment-Unary-Relational-Logical) Expressions Statements and Formula Based Calculations BlueJ User Input Arguments through main Class Object Creation and Access Wrapper Classes Constructor Basics Constructor Overloading Conversion and Checking Functions Math Functions Function building and calling Function overloading Simple If and If-Else Selection Multiple Conditional Selections Switch Based Selections Basic Loop Types Compound or Nested Loops Jumping within loops Loop Variations Loop Applications - Handling Numerals Specially Named Numbers Series Printing Pattern Printing Scanner Input Buffered Input Array Basics Array Search Array Sorting Other Array Manipulations Two Dimensional Arrays Basics Two Dimensional Arrays Manipulations Character Handling String Basics String Class Functions StringBuffer StringBuilder Types of Errors Exceptions using try-catch Defining Classes Introductory Sessions Beginning to Program Introductory Sessions Beginning to Program Introductory Sessions Beginning to Program Data Types Variables and Constants Introductory Sessions Beginning to Program Python Basics Beginning To Program Tokens, Keywords, Identifiers Variables and Expressions Data Types Operators Building Expressions Collecting User Input elational nary)


Back