0% found this document useful (0 votes)
8 views10 pages

SQL Database Management Basics

11

Uploaded by

namahshivayao11
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)
8 views10 pages

SQL Database Management Basics

11

Uploaded by

namahshivayao11
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

1)Create database:

To create a database named db1:

Create database db1:

Ex:

2)To make a database active:

Use db1;

Or

If the database name is school..

Use school;

3)See the existing databases ie already created databases:

Show databases;

4) To see the existing tables under a particular database:


Show tables:

5)To select the user data in a table:

Select * from employee;

6)To select particular columns:

Select ename, job, sal from employee;


7) To put alias for a column:

Select ename as “employee name”, ejob as “employee job” from employee;

8) Display only unique values in a column:

Select distinct ejob from employee;


9)TO obtain any calculations on numeric columns:

10) To arrange any column in ascending order:

Select ename , sal from employee order by ename asc;


11) To see the description of the table:
12)WHERE CLAUSE:
Single condition:

Multiple conditions: ( or condition is used when either of the


conditions or both of the conditions are true)

(and condition is used when both the conditions are true):


In operator can be used to match values within a list of values, it can be used to
replace multiple or conditions:

Between and :
Not between and:

Not in:

Like and not like:


IS NULL( NULL COMPARISON WITH IS NULL)

DDL:
DATA DESCRIPTION LANGUAGE
CREATE, ALTER,DROP:
These commands are used
to write new definitions in creations of tables with their respective column
labels,
to alter the table definitions by adding new column labels, dropping some
columns, modifying the column labels,change the column labels.
Once these commands are executed meta data is updated with the new
definitions

You might also like