TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   How to select multiple table in MySql (http://forums.techarena.in/software-development/1267524.htm)

Doroteo 05-11-2009 09:17 PM

How to select multiple table in MySql
 
Hi,
What is the better way to choose tables in My SQL. I have a bunch of databases in Access. The databases comprises of database related to customer queries. I need some basic guidelines on how efficiently I can make selections in the tables. Also how to get list of operators in a listed tables. Also how to select more than one table at a time. Thanks in advance.

Reegan 05-11-2009 09:20 PM

Re: How to select multiple table in MySql
 
The selection of all or part of a table is done through the Select statement. In this selection must be specified - The fields we want to select & The table that we make the selection. Like for example in a table model you have a customers selection consist of names and addresses of customers with a statement like this - Select name, address from customers. If you wanted to select all fields, i.e the whole table, we could use the * wildcard as follows. Select * from Customers. It is also very useful to filter the records using conditions that are expressed after the Where clause. If we wanted to show customers in a given city would use an expression like this: Select * From Customers Where population Like 'Asia'

opaper 05-11-2009 09:25 PM

Re: How to select multiple table in MySql
 
You can use operators will after the Where clause and can be skillfully combined using parentheses to optimize our selection at very high levels.
The basic Mathematical Operators are greater than, less than, less than or equal, unlike and same. In the same way the Logical Operators are and, or & not. The other specified operators used in table are, select the records whose field value resembles, disregarding case. Wildcards can also be used like * which replaces all fields, % which replaces anything or nothing in a chain and - which replaces a single character within a string.

MindSpace 05-11-2009 09:26 PM

Re: How to select multiple table in MySql
 
A database can be considered as a set of tables. These tables are often related to each other and complement each other. Referring to our classic example of a database for an application of e-commerce, customers table we have been discussing can be perfectly coordinated with a table where we store the orders placed by each customer. This table orders may in turn be onnected to a table where we store the data for each inventory item. Thus we could easily obtain information contained in these three tables such as the appointment of the most popular item in a region where the designation of the article would be obtained from the Items table, the popularity (number of times the item has been sold ) would come from the orders table and the region would fall clearly on the customers table.

Modifier 05-11-2009 09:28 PM

Re: How to select multiple table in MySql
 
Besides the criteria already explained for consultation in tables, SQL also allows for a set of predefined functions. These functions, although basic, can help at times to express our selection of a simpler way without having to resort to additional operations by the script we are running. The functions used under this are Sum (field) - Calculates the sum of the records of the specified field, Avg (Field) - Calculate the average of the records of the specified field, Count (*) - We provide the value of the number of records that have been selected, Max (Field) - It tells us which is the maximum value of the field & Min (Field) - It tells us which is the minimum value of the field.


All times are GMT +5.5. The time now is 12:14 AM.