KEMBAR78
SQL Removed | PDF | Sql | Computer Data
0% found this document useful (0 votes)
8 views11 pages

SQL Removed

The document provides an overview of SQL commands and their classifications, including Data Definition Language (DDL), Data Manipulation Language (DML), and Transaction Control Language (TCL). It details MySQL commands for creating, accessing, and managing databases and tables, as well as executing queries using the SELECT command and aggregate functions. Additionally, it explains the concept of JOIN operations to combine records from multiple tables.

Uploaded by

Kunal Vats
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 views11 pages

SQL Removed

The document provides an overview of SQL commands and their classifications, including Data Definition Language (DDL), Data Manipulation Language (DML), and Transaction Control Language (TCL). It details MySQL commands for creating, accessing, and managing databases and tables, as well as executing queries using the SELECT command and aggregate functions. Additionally, it explains the concept of JOIN operations to combine records from multiple tables.

Uploaded by

Kunal Vats
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
You are on page 1/ 11

INDEX

SQL and classification of its statements

SQL Commands:
 Viewing already created databases
 Creating databases
 Accessing databases
 Drop databases
 Viewing already created tables
 Renaming tables
 Creating tables
 Inserting data into tables
 Making simple queries through SELECT command
 Creating tables with SQL constraints
 Viewing a table structure
 Modifying data in tables
 Deleting data from tables
 Altering tables
 Dropping tables
 Order by clause

AGGREGATE FUNCTIONS
o AVG
o COUNT
o MAX
o MIN
o SUM
JOIN
MYSQL
MySQL is a freely available open-source
Relational Database Management System
(RDBMS) that uses Structured Query Language
(SQL). In a MySQL database, information is
stored in tables.

The Structured Query Language (SQL) is a


language that enables you to create and operate
on relational databases, which are sets of
related information stored in tables.

CLASSIFICATION OF SQL STATEMENTS :


Data Definition Language (DDL) Commands: Commands
that allow you to perform tsks related to data definition such as
creating, altering and dropping or maintenance commands,
Data Manipulation Language (DML) Commands:
Commands that allow you to perform data manipulation such as
retrieval, insertion, deletion and modification of data stored in a
database,
Transaction Control Language (TCL) Commands:
Commands that allow you to manage and control the
transactions.
MYSQL COMMANDS

o Viewing existing databases:


> show databases;
o Creating databases:
> create database <database name>;
o Accessing databases:
> use <database name>;
o Drop database:
>drop database <database name>;
o Viewing tables:
> show tables;
o Rename Table:
> alter table <old> rename <new>;
o Creating Tables:
> create table <name>(<column>
<datatype>[size] ….);
o Inserting data into tables:
> insert into <tablename> values (<value>,
<value>….);
o Viewing a table structure:
> desc <tablename>;
QUERIES THROUGH SELECT
COMMAND:

o Selecting all data:


 Select * from <table>;
o Selecting particular rows:
 Select * from <table> where <condition>;
o Selecting particular columns:
 Select <column>, <column> from <table>;
AGGREGATE FUNCTIONS

SUM()

COUNT() MIN()

Functions

MAX() AVG()
JOIN
A JOIN combines records from two tables.
JOIN matches related column values in two
tables.
A query can contain zero, one, or multiple JOIN
operations.
TABLE: BOOKS
ID Name Publisher Price
1 Tears First Pub. 300
2 Fast Cook TDH 900
3 C++ EPB 700

TABLE: ISSUED
ID Quantity
1 56
3 34

 select books.id,name,price from books, issued


where books.id=issued.id ;
ID NAME PRICE
1 Tears 300
3 C++ 700

You might also like