Question
Discuss the SQL view method of creating a query?

Answer

While forming the SQL statement, the following clauses are normally used for generating information (or Select) queries:
  1. SELECT: This clause is used to specify the fields to display data or information. Consider the following SQL statement segment:
SELECT Code, Name, Amount

The fields Code, Name and Amount after SELECT clause indicate the data items to be displayed by the query statement.
  1. FROM: This clause is meant to indicate the source of data in terms of tables or queries or a combination of both. Two tables are joined by specifying a JOIN clause based on a condition of Join. There can be three types of Join: Inner, Left and right.
  2. INNER: This Join clause is meant to display only exactly matching records between two data sources. Consider the following SQL statement segment:
FROM Accounts INNER JOIN AccountType

ON ( CatId = Type)

In the above statement, only those records of Accounts and AccountType table constitute the source of query data, which match exactly on CatId = Type.
  1. LEFT: With this Join, all the records in the primary table in the relationship are displayed irrespective whether there are matching records in the related table or not. Consider the following SQL statement segment :
FROM Accounts LEFT JOIN Account Type

ON ( CatId = Type)

In the above statement, all records of AccountType along with matching records of Accounts table constitute the source of query data. The matching condition is CatId = Type.
  1. RIGHT: With this Join, all the records of related table in the relationship are displayed irrespective whether there are matching records in the primary table or not. Consider the following SQL statement segment
FROM Accounts RIGHT JOIN AccountType

ON ( CatId = Type)
  1. WHERE: This clause in SQL statement is used to provide the condition to restrict the records to be returned by query. The resultant records of query must satisfy the condition which is specified after WHERE clause. This is meant to filter records returned by the query.
  1. ORDER BY: This clause is meant to specify the order in which the resultant records of query are required to appear. The basis of ordering is determined by the list of fields specified after the order by clause. Consider the following SQL statement segment:
ORDER BY Type, Cod
  1. GROUP BY: The group by clause is used in the SQL statement to enable grouping of records for creating summary query. The fields after GROUP BY clause constitute the basis of grouping for which summary results are obtained. Consider the following SQL statement:

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Prepare the trading and profit and loss account and balance sheet of M/s ontrol Device India on March 31, 2017 from the following balance as on that date.
Closing stock was valued ₹ 20,000.
  1. Interest on capital @ 10%.
  2. Interest on drawings @ 5%.
  3. Wages outstanding ₹ 50.
  4. Outstanding salary ₹ 20.
  5. Provide a depreciation @ 5% on plant and machinery.
  6. Make a 5% provision on debtors.
From the following Trial Balance extracted from the books of S. Sujan Singh, prepare a Trading and Profit & Loss Account for the year ended 31st March, 2016 and a Balance Sheet as at that date:

Adjustments:
  1. Carry forward the following unexpired amounts:-
(i)
Fire Insurance
₹ 125
(ii)
Rates and Taxes
₹ 240
  1. Transfer to Building Account ₹ 3,000 from purchases and ₹ 2,000 from wages, representing cost of material and labour spent on additions to Building made during the year.
  2. Charge Depreciation on Land and Buildings at 2.5% and on Plant & Machinery at 10%.
  3. Make a Provision of 5% on Sundry Debtors for Bad-debts.
  4. Charge 5% Interest on Capital but not on Drawings.
  5. The value of Stock as on 31st March, 2016 was ₹ 29,390.
On 30th June, 2019, bank column of the Cash Book showed balance of ₹ 12,000 but the Pass Book showed a different balance due to the following reasons:
  1. Cheques paid into the bank ₹ 8,000 but out of these only cheques of ₹ 6,500 credited by bankers.
  2. The receipts column of the Cash Book undercast by ₹ 200.
  3. On 29th June, a customer deposited ₹ 3,000 directly in the Bank Account but it was entered in the Pass Book only.
  4. Cheques of ₹ 9,200 were issued of which ₹ 2,200 were presented for payment on 15th July.
  5. Pass Book shows a credit of ₹ 330 as interest and a debit of ₹ 60 as bank charges.
Prepare Bank Reconciliation Statement as on 30th June, 2019.
State the necessary steps that are required to be taken to convert Single Entry Books into Double Entry Books.
​​From the following information supplied by Mr. D.H., prepare his Bank Reconciliation Statement as on 31st March, 2019:
   
(i) Bank overdraft as per Pass Book. 33,000
(ii) Cheques issued but not presented for payment. 17,500
(iii) Cheques deposited but not collected. 21,000
(iv) Cheques recorded in the Cash Book but not sent to the bank for collection. 4,000
(v) Payment received from customers directly by the bank. 7,000
(vi) Bank charges debited in the Pass Book. 40
(vii) Premium of Life Insurance Policy of Mr. D.H. paid by the bank on standing instructions. 360
(viii) A bill for ₹ 6,000 dishonoured on 30th March, 2019 and bank paid Noting charges ₹ 20. This bill was discounted on 30th January, 2019.  
What is the use of Data Base Management?
What is a Computer? What are its important features?
From the following balances, prepare Trading and Profit and Loss Account and Balance Sheet:
Closing Stock was valued at ₹ 30,000.
Following information is obtained from the books of Vinay, who maintained his books of account under Single Entry System:
Vinay banks all receipts and makes payments by means of cheque.
From the above information, prepare Trading and Profit and Loss Account for the year ended 31st March, 2019 and Balance Sheet as on that date.
On 1st January, 2019, A drew a bill on B for ₹ 10,000 payable after 3 months. B accepted the bill and returned it to A. After 10 days, A endorsed the bill to his creditor C. On the due date, the bill was dishonoured and C paid ₹ 50 as noting charges.
Record the transactions in the books of A, B and C.