Purchase Solution

MySQL SELECT Statements

Not what you're looking for?

Ask Custom Question

Write SELECT statements for the following questions. Make sure to include the statement execution, including the resulting data.

Display all columns and all rows from the Employees table.
9 rows returned
Display the regionid, regiondescription for all rows in the Regions table.
4 rows returned
Modify query 2 so that the column headings are as follows:
"ID" and "Description"
4 rows returned
Display the customer ID, customer name, and region for all customers.
91 rows returned
Display the customer ID, customer name, and region for all customers.
Name the columns "ID," "Name," and "Region" (respectively), and sort the data by the company name.
91 rows returned

So far from my experience this is what I have come up for as what a Select Statement sort of contains, I could be wrong.

The syntax would be SELECT [column] FROM [table]
So let's say I was selecting a column called "Birthday" from a table named "People" , it would be :
SELECT Birthday
FROM People
with multiple columns, you need to use a comma
EXAMPLE:
SELECT, first_name, Birthday
FROM People

Now I just need to put that knowledge to solve the 5 statements above, can anyone help me with this please ?

Purchase this Solution

Solution Preview

The syntax for your select statement is correct. If you want to return all the columns and all the rows you can use the syntax:
SELECT * FROM ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

C# variables and classes

This quiz contains questions about C# classes and variables.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.