logo
logo
Sign in

SQL Statement Select | PHP Gurukul

avatar
PHPGurukul
SQL Statement Select | PHP Gurukul
SQL Basic Commands

The SQL SHOW statement displays information contained in the database and its tables. This helpful tool lets you keep track of your database contents and remind yourself about the structure of your tables.

For example, the SHOW DATABASES command lists the databases managed by the server.

 

1

SHOW DATABASES;

The SHOW TABLES command is used to display all of the tables in the currently selected MySQL database.

SHOW COLUMNS displays information about the columns in a given table.


Click here to get Full Access : https://phpgurukul.com/sql-statement-select/

The following example displays the columns in our customers table:

 

1

SHOW COLUMNS FROM customers;

SHOW COLUMNS displays the following values for each table column:


Field: column name

Type: column data type

Key: indicates whether the column is indexed

Default: default value assigned to the column

Extra: may contain any additional information that is available about a given column.

SELECT Statement

The SELECT statement is used to select data from a database.

The result is stored in a result table, which is called the result-set.


query may retrieve information from selected columns or from all columns in the table.

To create a simple SELECT statement, specify the name(s) of the column(s) you need from the table.


Syntax of the SQL SELECT Statement:

 

1

SELECT column_list FROM table_name;

– column_list includes one or more columns from which data is retrieved

– table-name is the name of the table from which the information is retrieved


Below is the data from our customers table:

The following SQL statement selects the FirstName from the customers table:

 

1

SELECT FirstName,LastName FROM customers;


PHP Gurukul

Welcome to PHPGurukul. We are a web development team striving our best to provide you with an unusual experience with PHP. Some technologies never fade, and PHP is one of them. From the time it has been introduced, the demand for PHP Projects and PHP developers is growing since 1994. We are here to make your PHP journey more exciting and useful.

Website : https://phpgurukul.com

collect
0
avatar
PHPGurukul
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more