The SELECT statement is used to select data from a database. The data returned is stored in a result table, sometimes called the result set.
The basic syntax of the SELECT statement is: SELECT column1, column2, ... FROM table_name;
SELECT first_name, last_name FROM employees;
This example selects the first and last names of all employees from the "employees" table.
Console Output:
John Doe
Jane Smith
The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition.
The basic syntax of the WHERE clause is: SELECT column1, column2, ... FROM table_name WHERE condition;
SELECT * FROM employees WHERE department = 'Sales';
This example selects all columns from the "employees" table where the department is "Sales".
Console Output:
ID: 1, Name: John Doe, Department: Sales
The INSERT INTO statement is used to insert new records in a table.
The basic syntax of the INSERT INTO statement is: INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
INSERT INTO employees (first_name, last_name, department) VALUES ('Alice', 'Wonderland', 'HR');
This example inserts a new record into the "employees" table with the first name "Alice", last name "Wonderland", and department "HR".
Console Output:
Record inserted successfully.
The UPDATE statement is used to modify the existing records in a table.
The basic syntax of the UPDATE statement is: UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition;
UPDATE employees SET department = 'Marketing' WHERE first_name = 'Alice';
This example updates the department of the employee with the first name "Alice" to "Marketing".
Console Output:
Record updated successfully.
The DELETE statement is used to delete existing records in a table.
The basic syntax of the DELETE statement is: DELETE FROM table_name WHERE condition;
DELETE FROM employees WHERE first_name = 'Alice';
This example deletes the record of the employee whose first name is "Alice".
Console Output:
Record deleted successfully.
The ORDER BY keyword is used to sort the result set in ascending or descending order.
The basic syntax of the ORDER BY clause is: SELECT column1, column2, ... FROM table_name ORDER BY column1, column2, ... ASC|DESC;
SELECT first_name, last_name FROM employees ORDER BY last_name DESC;
This example selects the first and last names of employees and sorts them by last name in descending order.
Console Output:
Smith, Jane
Doe, John
The GROUP BY statement is used in conjunction with aggregate functions to group the result set by one or more columns.
The basic syntax of the GROUP BY clause is: SELECT column1, aggregate_function(column2) FROM table_name GROUP BY column1;
SELECT department, COUNT(*) FROM employees GROUP BY department;
This example counts the number of employees in each department.
Console Output:
Sales: 5
HR: 3
The JOIN clause is used to combine rows from two or more tables, based on a related column between them.
The basic syntax of the JOIN clause is: SELECT columns FROM table1 INNER JOIN table2 ON table1.column = table2.column;
SELECT employees.first_name, departments.department_name FROM employees INNER JOIN departments ON employees.department_id = departments.id;
This example selects the first names of employees along with their department names by joining the "employees" and "departments" tables.
Console Output:
John, Sales
Jane, HR
Newsletter
Subscribe to our newsletter for weekly updates and promotions.
Wiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterCompany
About usCareersPressCompany
About usCareersPressCompany
About usCareersPressLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesCompany
About usCareersPressCompany
About usCareersPressCompany
About usCareersPressLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesAds Policies