SQL<\/strong> SQL<\/strong> is a standard Database language which is used to create, maintain and retrieve the data from relational databases like MySQL, Oracle, SQL Server, PostGre, etc<\/p>\n\n\n\n RDBMS stands for Relational Database Management System.<\/p>\n\n\n\n It is the basis for SQL, and for all modern database systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.<\/p>\n\n\n\n The data in RDBMS is stored in database objects called tables. A table is a collection of related <\/mark>entries and it consists of columns and rows.<\/p>\n\n\n\n A database most often contains one or more tables. Each table is identified by a name.<\/p>\n\n\n\n Most of the actions you need to perform on a database are done with SQL statements.<\/p>\n\n\n\n Some database systems require a semicolon at the end of each SQL statement.<\/p>\n\n\n\n Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server.<\/p>\n\n\n\n The The data returned is stored in a result table called the result-set.<\/p>\n\n\n\n SELECT column1<\/em>, column2, …<\/em> Here, column1, column2, … are the field names of the table you want to select data from. To select all the fields available in the table, use the following syntax: <\/p>\n\n\n\n SELECT * FROM table_name<\/em>;<\/p>\n\n\n\n The Inside a table, a column often contains many duplicate values; and sometimes you only want to list the different (distinct) values.<\/p>\n\n\n\n SELECT DISTINCT column1<\/em>, column2, …<\/em> <\/p>\n\n\n\n The following SQL statement lists the number of different (distinct) customer countries:<\/p>\n\n\n\n SELECT COUNT(DISTINCT Country) FROM Customers;<\/p>\n\n\n\n Note: The example above will not work in Firefox!<\/strong> Because COUNT(DISTINCT column_name<\/em>) is not supported in Microsoft Access databases. Firefox is using Microsoft Access in our examples.<\/p>\n\n\n\n Here is the workaround for MS Access:<\/p>\n\n\n\n SELECT Count(*) AS DistinctCountries The It is used to extract only those records that fulfill a specified condition.<\/p>\n\n\n\n SELECT column1<\/em>, column2, …<\/em> Note:<\/strong> The <\/mark><\/p>\n\n\n\n <\/p>\n\n\n\n The following operators can be used in the SQL is a standard language for storing, manipulating and retrieving data in databases. What is SQL? SQL is a standard Database language which is used to create, maintain and retrieve the data from relational databases like MySQL, Oracle, SQL Server, PostGre, etc SQL stands for Structured Query Language It lets […]<\/p>\n","protected":false},"author":8,"featured_media":2213,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[62,16],"tags":[115],"jetpack_publicize_connections":[],"yoast_head":"\n <\/strong><\/code>is a standard language<\/a> for storing, manipulating and retrieving data<\/a>
<\/code>in databases.<\/p>\n\n\n\n
What is SQL?<\/h2>\n\n\n\n
RDBMS<\/h2>\n\n\n\n
Database Tables<\/h2>\n\n\n\n
SQL Statements<\/h2>\n\n\n\n
Semicolon after SQL Statements?<\/h2>\n\n\n\n
Keep in Mind That…<\/h2>\n\n\n\n
select<\/code> is the same as
SELECT<\/code><\/li><\/ul>\n\n\n\n
Some of The Most Important SQL Commands<\/h2>\n\n\n\n
SELECT<\/code> – extracts data from a database<\/li>
UPDATE<\/code> – updates data in a database<\/li>
DELETE<\/code> – deletes_data from a database<\/li>
INSERT INTO<\/code> – inserts new_data into a database<\/li>
CREATE DATABASE<\/code> – creates a new database<\/li>
ALTER DATABASE<\/code> – modifies a database<\/li>
CREATE TABLE<\/code> – creates a new table<\/li>
ALTER TABLE<\/code> – modifies a table<\/li>
DROP TABLE<\/code> – deletes a table<\/li>
CREATE INDEX<\/code> – creates an index (search key)<\/li>
DROP INDEX<\/code> – deletes an index<\/li><\/ul>\n\n\n\n
The SQL SELECT Statement<\/h2>\n\n\n\n
SELECT<\/code> statement is used to select data from a database.<\/p>\n\n\n\n
SELECT Syntax<\/h3>\n\n\n\n
FROM table_name<\/em>;<\/p>\n\n\n\nThe SQL SELECT DISTINCT Statement<\/h2>\n\n\n\n
SELECT DISTINCT<\/code> statement is used to return only distinct (different) values.<\/p>\n\n\n\n
SELECT DISTINCT Syntax<\/h3>\n\n\n\n
FROM table_name<\/em>;<\/p>\n\n\n\nExample<\/h3>\n\n\n\n
Example<\/h3>\n\n\n\n
FROM (SELECT DISTINCT Country FROM Customers);<\/p>\n\n\n\nThe SQL WHERE Clause<\/h2>\n\n\n\n
WHERE<\/code> clause is used to filter records.<\/p>\n\n\n\n
WHERE Syntax<\/h3>\n\n\n\n
FROM table_name<\/em>
WHERE condition<\/em>;<\/p>\n\n\n\nWHERE<\/code> clause is not only used in
SELECT<\/code> statements, it is also used in
UPDATE<\/code>,
DELETE<\/code>, etc.!<\/p>\n\n\n\n
Operators in The WHERE Clause<\/h2>\n\n\n\n
WHERE<\/code> clause:<\/p>\n\n\n\n
Operator<\/th> Description<\/th> <\/th><\/tr> =<\/td> Equal<\/td> <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n ><\/td> Greater than<\/td> <\/td><\/tr> <<\/td> Less than<\/td> <\/td><\/tr> >=<\/td> Greater than or equal<\/td> <\/td><\/tr> <=<\/td> Less than or equal<\/td> <\/td><\/tr> <><\/td> Not equal. Note:<\/strong> In some versions of SQL this operator may be written as !=<\/td> <\/td><\/tr> BETWEEN<\/td> Between a certain range<\/td> <\/td><\/tr> LIKE<\/td> Search for a pattern<\/td> <\/td><\/tr> IN<\/td> To specify multiple possible values for a column<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"