The SELECT statement is used to query the database and retrieve data from one or more tables. It is the most commonly used command in SQL.
SELECT column1, column2 FROM table_name WHERE condition;
This query selects the columns 'name' and 'age' from the 'users' table where the age is greater than 30.
SELECT name, age FROM users WHERE age > 30;
Console Output:
John, 35
Alice, 32
The INSERT INTO statement is used to add new rows of data to a table in the database.
INSERT INTO table_name (column1, column2) VALUES (value1, value2);
This query inserts a new user into the 'users' table with the name 'Bob' and age '28'.
INSERT INTO users (name, age) VALUES ('Bob', 28);
Console Output:
INSERT 0 1
The UPDATE statement is used to modify existing records in a table.
UPDATE table_name SET column1 = value1 WHERE condition;
This query updates the age of the user 'Alice' to '33' in the 'users' table.
UPDATE users SET age = 33 WHERE name = 'Alice';
Console Output:
UPDATE 1
The DELETE statement is used to remove existing records from a table.
DELETE FROM table_name WHERE condition;
This query deletes the user 'Bob' from the 'users' table.
DELETE FROM users WHERE name = 'Bob';
Console Output:
DELETE 1
The CREATE TABLE statement is used to create a new table in the database.
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
PRIMARY KEY (column1)
);
This query creates a new table 'employees' with columns 'id' and 'name'.
CREATE TABLE employees (
id SERIAL PRIMARY KEY,
name VARCHAR(100)
);
Console Output:
CREATE TABLE
The ALTER TABLE statement is used to modify an existing table structure, such as adding or dropping columns.
ALTER TABLE table_name ADD column_name datatype;
This query adds a new column 'email' to the 'employees' table.
ALTER TABLE employees ADD email VARCHAR(255);
Console Output:
ALTER TABLE
The DROP TABLE statement is used to remove a table and all its data from the database.
DROP TABLE table_name;
This query deletes the 'employees' table from the database.
DROP TABLE employees;
Console Output:
DROP TABLE
The CREATE INDEX statement is used to create an index on a table for faster retrieval of records.
CREATE INDEX index_name ON table_name (column1, column2);
This query creates an index on the 'name' column of the 'users' table.
CREATE INDEX idx_name ON users (name);
Console Output:
CREATE INDEX
The GRANT statement is used to provide specific privileges to users or roles on database objects.
GRANT privilege_name ON object_name TO user_name;
This query grants SELECT privilege on the 'users' table to the user 'john'.
GRANT SELECT ON users TO john;
Console Output:
GRANT
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