The modification of information stored in the database Query Language A is a statement requesting the retrieval of information. The portion of a DML that involves query information retrieval is called a Although technically incorrect, it is common practice to use query language. the terms and synonymously. query language data-manipulation language The Operation / Statement SELECT The statement is used to retrieve information from the database according to provided SELECT conditions. To demonstrate the use of statement, let’s assume the following two relation instances. SELECT customer_name customer_street customer_city account_number customer_name balance Somebody Mirpur Road Dhaka A-101 Anybody 1000 Somebody Aga Kha Road Bogra A-102 Anybody 1500 Anybody XYZ Road Khagrachhori A-103 Somebody 2000 Nobody Mirpur Road Dhaka A-104 Nobody 2500 customer account Q1. From the table, find out the information of all the customers who live in Dhaka. customer select from where * customer customer_city = 'Dhaka'; Output: customer_name customer_street customer_city Somebody Mirpur Road Dhaka Nobody Mirpur Road Dhaka Q2. From the table, find out the information of all the customers who live in either customer Dhaka or Bogra. select from where or * customer customer_city = 'Dhaka' customer_city = 'Bogra'; Output: customer_name customer_street customer_city Somebody Mirpur Road Somebody Aga Kha Road Bogra Nobody Mirpur Road Q3. Find out the customers along with their account numbers who have account balances of at least 2000 taka. select from where customer_name, account_number account balance >= 2000; Output: customer_name account_number Somebody A-103 Nobody A-104 From the above three queries, we can observe the general structure for the statement: select SELECT attribute_1, attribute_2, ... , attribute_N FROM WHERE expression The after the phrase are those attributes which we want to display at the attributes SELECT output result.
The modification of information stored in the database Query Language A query is a statement requesting the retrieval of information. The portion of a DML that involves information retrieval is called a query language. Although technically incorrect, it is common practice to use the terms query language and data-manipulation language synonymously. The SELECT Operation / Statement The SELECT statement is used to retrieve information from the database according to provided conditions. To demonstrate the use of SELECT statement, let’s assume the following two relation instances. customer_name customer_street customer_city account_number customer_name balance Somebody Mirpur Road Dhaka A-101 Anybody 1000 Somebody Aga Kha Road Bogra A-102 Anybody 1500 Anybody XYZ Road Khagrachhori A-103 Somebody 2000 Nobody Mirpur Road Dhaka A-104 Nobody 2500 customer account Q1. From the customer table, find out the information of all the customers who live in Dhaka. select * from customer where customer_city = 'Dhaka'; Output: customer_name customer_street customer_city Somebody Mirpur Road Dhaka Nobody Mirpur Road Dhaka Q2. From the customer table, find out the information of all the customers who live in either Dhaka or Bogra. select * from customer where customer_city = 'Dhaka' or customer_city = 'Bogra'; Output: customer_name customer_street customer_city Somebody Mirpur Road Somebody Aga Kha Road Bogra Nobody Mirpur Road Q3. Find out the customers along with their account numbers who have account balances of at least 2000 taka. select customer_name, account_number from account where balance >= 2000; Output: customer_name account_number Somebody A-103 Nobody A-104 From the above three queries, we can observe the general structure for the select statement: SELECT attribute_1, attribute_2, ... , attribute_N FROM WHERE expression The attributes after the SELECT phrase are those attributes which we want to display at the output result.
DBMS_An_Interactive_Tutorial.docx