Page 237 - Open Soource Technologies 304.indd
P. 237

Open Source Technologies



                   Notes         14.2.3 Issuing Queries

                                 After you are connected to the server you are ready to issue queries.
                                 In MySQL the keywords and functions can be in uppercase or lowercase.

                                 But the database name and table name must be in proper case as in Unix system the files and
                                 directives are case sensitive.
                                 To enter a query in mysql, just type it, end it with a semicolon(;) and press enter. The semicolon
                                 tells mysql that the query is complete. You can also use ‘\g’ to terminate queries.

                                 Examples and results of some simple query is given below:
                                 mysql>SELECT NOW();

















                                                When you invoke a function in query, there must be no space between function
                                                name and following parenthesis.

                                 As my sql waits for the semicolon before sending the query to the server, you don’t need to
                                 enter it on a single line. You can spread a query over several lines if you want:

                                 mysql>SELECT NOW(),

                                 ->USER(),

                                 ->VERSION()
                                 ->;


























        232                               LOVELY PROFESSIONAL UNIVERSITY
   232   233   234   235   236   237   238   239   240   241   242