MySQL
      My Structured Query Language

Lesson 5 SELECT Functions

Exercise 1

5-1-2.jpg

Bring together the first and last names as one.

Ques: I added another field to record the spouse names. Some do not have a spouse. When I ran this CONCAT on fname,' & ',spouse,' ',lname the result was fname & lname where there was no spouse. Maybe it takes PHP to control the placement of the ampersand only when there is a spouse?

5-1-3.jpg

I didn't have any birthdays recorded so I formatted the value of art items. At least this is something that I kinda figured out on my own.

5-1-4.jpg

Record COUNT is simple.

This Goes Back to Lesson 4

I tried many, many times all unsuccessful, to join another table. I most cases I got an error message that within the 'ON' clause was something ambiguous. The statement itself was 'ambiguous'. When I finally rid the statement free of Errors, this is the result:

dont-understand.jpg

Why did it list everything 5 times? Oh, it ever did JOIN the category of the art items. If either of the "category" included after ON are changed to "category_id" there is the ambiguous error.

The other parts, INSERT, DELETE were easy and used earlier making changes to my tables.

As this is the last lesson — one more question. In the collections table is a field for an image. How is the path determined for a MySQL table. I do see a folder at my XAMPP folder named MySQL and I can find there 'chucks_database' that I first created. At my hosting site, there is only the htdocs root folder. If I log-in to my hosting site where all the service features are found, I do find MySQL. So, if I want to develop something into a database that is already at my host, do I have to create that database at the hosting site? Can databases be uploaded to a hosting site?

I've much more to learn. It's difficult.