0% found this document useful (0 votes)
96 views

On DBMS Presentation.....

The document discusses various SQL statements used for database and table management. It explains statements to create and drop databases and tables, as well as statements to select, insert, update, delete and describe table data. Key statements covered include CREATE DATABASE, DROP DATABASE, USE DATABASE, SHOW TABLES, CREATE TABLE, DESC, DROP TABLE, INSERT, SELECT, WHERE, FROM, DISTINCT, UPDATE, ALTER TABLE, and DELETE. Examples are provided for many of the statements.

Uploaded by

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

On DBMS Presentation.....

The document discusses various SQL statements used for database and table management. It explains statements to create and drop databases and tables, as well as statements to select, insert, update, delete and describe table data. Key statements covered include CREATE DATABASE, DROP DATABASE, USE DATABASE, SHOW TABLES, CREATE TABLE, DESC, DROP TABLE, INSERT, SELECT, WHERE, FROM, DISTINCT, UPDATE, ALTER TABLE, and DELETE. Examples are provided for many of the statements.

Uploaded by

aditya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

QUERIES.

Aditya/SOE sec-23 1
Creating and dropping a database

This statement is used to create a database.

SYNTAX:
CREATE DATABASE databasename;

The SQL DROP DATABASE Statement is used to drop or delete an existing


table.
Dropping of database will drop all database objects inside it.
The drop statement cannot be rollback.

SYNTAX:
DROP DATABASE databasename;
Aditya/SOE sec-23 2
USE DATABASE Statement
The use database statement is
used to access into database
SYNTAX
USE databasename;

SHOW TABLE Statement


It is used to view the tables in a database.

SYNTAX
SHOW TABLES;

Aditya/SOE sec-23 3
Creating table

Example

Aditya/SOE sec-23 4
DESC command
This command is used to view the structure.
The MySQL’s DESCRIBE or DESC both are equivalent. The DESC is the
short form of DESCRIBE command and used to dipslay the information
about a table like column names and constraints on column name.

SYNTAX
DESC tablename;
OR
DESCRIBE tablename;

Aditya/SOE sec-23 5
DROP TABLE Command
This command is used to remove the entire structure of the table
and information. This is also from the DDL command.

Example

Aditya/SOE sec-23 6
Insert Command

Aditya/SOE sec-23 7
Select, Where, and From clause
SELECT
The SQL SELECT statement is used to fetch data from a database table which
returns this data in the form of a result table. We can also says the SELECT
statements is used to select data from a database. SYNTAX:
This command is used to view table information from SQL database. By using
SELECT command, we can get one or more fields information, while using *, one SELECT (*/field list)
can get all fields information.
FROM <table name>
[WHERE <condition>];
WHERE CLAUSE
The SQL WHERE clause is used to specify a condition while fetching the data from
a single table or by joining with multiple tables. If the condition is satisfied , then
only it returns a specific value from the table.

FROM CLAUSE
A WHERE clause in SQL specifies that a SQL Data Manipulation Language (DML)
statement should only affect rows that meet specified criteria.

Aditya/SOE sec-23 8
Distinct command
The DISTINCT keyword is used to remove duplicate values in a particular column .

Example

Aditya/SOE sec-23 9
UPDATE Command
This command is used to implement modification of the data values.

Example

Aditya/SOE sec-23 10
ALTER TABLE Command
This command is used to implement modification of the structure of the table. This is a DDL
command. Using this command, we can add a new column, remove the existing column and modify
data type of existing column.

Example

Aditya/SOE sec-23 11
DELETE Command
This command is used to remove information from a particular row or rows. Please
remember that this command will delete only row information but not the structure of the
table.

Example

Aditya/SOE sec-23 12

You might also like