📖 generic · CBSE Class 11 English medium · ACCOUNTANCY · Page 1question

Database Management System · Part 45

Chapter 15: Accounting System Using Database Management System · ACCOUNTANCY

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. (iv) 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 AccountType ON ( CatId=Type) In the above statement, all records of Accounts along with matching records of AccountType table constitute the source of query data, The matching condition is CatId = Type.

(v) 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) 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. (iv) 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. (v) 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, Code The above statement in the context of Accounts table implies that the resultant record set is ordered by the Type field of Accounts and within Type, by Code field of Accounts. (vi) GROUP BY : The group by clause is used in the SQL statement to enable grouping of records for creating summary query. The

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →