0% found this document useful (0 votes)
49 views1 page

Basic SQL Commands Overview

The document outlines basic SQL commands used for managing databases and tables. It includes commands for listing databases, creating tables, inserting records, retrieving data, deleting records, and dropping tables or databases. Each command is accompanied by its purpose for clarity.

Uploaded by

Tessiana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views1 page

Basic SQL Commands Overview

The document outlines basic SQL commands used for managing databases and tables. It includes commands for listing databases, creating tables, inserting records, retrieving data, deleting records, and dropping tables or databases. Each command is accompanied by its purpose for clarity.

Uploaded by

Tessiana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Subject: Class 10, Information Technology

Prepared by: Ms. Anjali Nair

BASIC SQL COMMANDS

COMMAND PURPOSE
SHOW DATABASES; List all databases on the server
USE Database _Name; Switch to a Database
CREATE TABLE Table_name ( Create table with the attribute specifications
Column1 Datatype, Possible Constraints – (PRIMARY KEY,NOT
Column2 Datatype, NULL,FOREIGN KEY)
Column3 Datatype);
DESC Table_name; To see the table description
Or
DESCRIBE Table_name;
INSERT INTO Table_name VALUES To insert a single record into a table
(Value1,Value2,Value3);
INSERT INTO Table_name(Column1,Column2) To insert multiple records into a table
VALUES (Value1, Value2),(Value3,Value4);
SELECT *FROM Table_name; To retrieve and display all the records in a table
SELECT *FROM Table_name WHERE To retrieve and display the record/s which satisfies
Column_name=value; the WHERE condition
SELECT *FROM Table_name ORDER BY To sort the records in ascending or descending order
Column_name ASC/DESC; based on a column
SELECT Column1,Column2 FROM To retrieve and display selected columns from a
Table_name; table.
DELETE FROM Table_name WHERE To delete a record from a table
<CONDITION>;
DROP TABLE Table_name; Delete the entire table
DROP DATABASE Database_Name; To delete a specific database from a server

You might also like