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

SQL Server: Aga Private Institute For Computer Science Programing Department 5 Stage

The document discusses SQL and database concepts like selecting a database, SQL syntax, creating a database, and dropping a database. It provides examples and explanations of SQL statements like USE, CREATE DATABASE, and DROP DATABASE.

Uploaded by

Aram Najat
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)
26 views

SQL Server: Aga Private Institute For Computer Science Programing Department 5 Stage

The document discusses SQL and database concepts like selecting a database, SQL syntax, creating a database, and dropping a database. It provides examples and explanations of SQL statements like USE, CREATE DATABASE, and DROP DATABASE.

Uploaded by

Aram Najat
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/ 7

SQL Server

aga Private Institute for Computer Science


Programing Department
5th Stage
Outline
Select DATABASE ?
Select Database
When you have multiple databases in your SQL Schema, then
before starting your operation, you would need to select a
database where all the operations would be performed.

The SQL USE statement is used to select any existing database


in SQL schema.

Syntax : USE DatabaseName ;

Example:
USE TestDB1 ;
SQL Syntax

All the SQL statements start with any of the


keywords like
SELECT, INSERT, UPDATE, DELETE, ALTER,
DROP, CREATE, USE, SHOW and all the
statements end with a semicolon (;).

4
SQL Syntax

Important point to be noted is that SQL is case insensitive,


which means SELECT and select have same meaning in SQL
statements.

SeLEct *
fROm REQueST
wHErE aCcT_sT In [‘GA’,’WA’,’NJ’];
Create Database

The SQL CREATE DATABASE statement is used to create


new SQL database.
Syntax :

CREATE DATABASE DatabaseName;


Always database name should be unique within the RDBMS.

Example:

CREATE DATABASE School ;

6
Drop Database

The SQL DROP DATABASE statement is used to drop ( delete )


an existing database in SQL schema.
Syntax :

DROP DATABASE DatabaseName;

Example:

DROP DATABASE TestDB1 ;


NOTE: Be careful before using this operation because by deleting an
existing database would result in loss of complete information stored in
the database. must not be in itself, because it used at already.

You might also like