SlideShare a Scribd company logo
********************************************************************************
*****************************************************
CASSANDRA BASICS - SHELL COMMANDS
********************************************************************************
*****************************************************
HELP:
====
Displays help topics for all cqlsh commands.
Ex:
--
HELP
--------------------------------------------------------------------------------
----------------------------------------------------
CAPTURE:
=======
Captures the output of a command and adds it to a file.
Ex:
--
CAPTURE '/home/hadoop/CassandraProgs/Outputfile';
verification:
------------
CAPTURE '/home/hadoop/CassandraProgs/Outputfile';
select * from emp;
CAPTURE OFF;
--------------------------------------------------------------------------------
----------------------------------------------------
CONSISTENCY:
===========
Shows the current consistency level, or sets a new consistency level.
Ex:
--
CONSISTENCY
--------------------------------------------------------------------------------
----------------------------------------------------
COPY:
====
Copies data to and from Cassandra.
Ex:
--
COPY emp (emp_id, emp_city, emp_name, emp_phone, emp_sal) TO ‘myfile‘;
--------------------------------------------------------------------------------
----------------------------------------------------
DESCRIBE:
=========
Describes the current cluster of Cassandra and its objects.
Ex:
--
DESCRIBE CLUSTER;
DESCRIBE KEYSPACES;
DESCRIBE TABLES;
DESCRIBE TABLE emp;
DESCRIBE COLUMNFAMILIES;
DESCRIBE TYPES;
DESCRIBE TYPE card_details;
--------------------------------------------------------------------------------
----------------------------------------------------
EXPAND:
======
Expands the output of a query vertically.
Ex
--
EXPAND ON
EXPAND OFF
verificarion:
------------
EXPAND ON
select * from emp;
EXPAND OFF
--------------------------------------------------------------------------------
----------------------------------------------------
EXIT:
====
Using this command, you can terminate cqlsh.
--------------------------------------------------------------------------------
----------------------------------------------------
PAGING:
======
Enables or disables query paging.
--------------------------------------------------------------------------------
----------------------------------------------------
SHOW:
====
Displays the details of current cqlsh session such as Cassandra version, host,
or data type assumptions.
Ex:
--
SHOW HOST;
SHOW VERSION;
--------------------------------------------------------------------------------
----------------------------------------------------
SOURCE:
======
Executes a file that contains CQL statements.
Ex:
--
SOURCE '/home/hadoop/CassandraProgs/inputfile';
--------------------------------------------------------------------------------
----------------------------------------------------
TRACING:
=======
Enables or disables request tracing.
********************************************************************************
*****************************************************
KEYSPACE OPERATIONS
********************************************************************************
*****************************************************
CREATE KEYSPACE:
====== ========
Creates a KeySpace in Cassandra.
USE:
===
Connects to a created KeySpace.
Syntax
------
CREATE KEYSPACE <identifier> WITH <properties>
CREATE KEYSPACE "KeySpace Name" WITH replication = {'class': ‘Strategy name‘,
'replication_factor' : ‘No.Of replicas‘};
CREATE KEYSPACE "KeySpace Name" WITH replication = {'class': ‘Strategy name‘,
'replication_factor' : ‘No.Of replicas‘} AND DURABLE_WRITES = ‘Boolean value‘;
USE <identifier>
Ex:
---
USE tutorialspoint;
CREATE KEYSPACE tutorialspoint WITH replication = {'class':'SimpleStrategy',
'replication_factor' : 3};
CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy',
'datacenter1' : 3 } AND DURABLE_WRITES = false;
verification:
------------
DESCRIBE KEYSPACES;
SELECT * FROM system.schema_keyspaces;
--------------------------------------------------------------------------------
----------------------------------------------------
ALTER KEYSPACE:
===== ========
Changes the properties of a KeySpace.
Syntax
------
ALTER KEYSPACE <identifier> WITH <properties>
ALTER KEYSPACE "KeySpace Name" WITH REPLICATION = {'class': ‘Strategy name‘,
'replication_factor' : ‘No.Of replicas‘};
ALTER KEYSPACE "KeySpace Name" WITH REPLICATION = {'class': ‘Strategy name‘,
'replication_factor' : ‘No.Of replicas‘} AND DURABLE_WRITES = ‘Boolean value‘;
Ex:
--
ALTER KEYSPACE tutorialspoint WITH REPLICATION =
{'class':'NetworkTopologyStrategy', 'replication_factor' : 3};
ALTER KEYSPACE test WITH REPLICATION = {'class' : 'NetworkTopologyStrategy',
'datacenter1' : 3} AND DURABLE_WRITES = true;
verification:
------------
SELECT * FROM system.schema_keyspaces;
--------------------------------------------------------------------------------
----------------------------------------------------
DROP KEYSPACE:
==== ========
Removes a KeySpace
Syntax
------
DROP KEYSPACE <identifier>
DROP KEYSPACE "KeySpace name"
Ex:
--
DROP KEYSPACE tutorialspoint;
verification:
------------
DESCRIBE KEYSPACES;
********************************************************************************
*****************************************************
TABLE OPERATIONS
********************************************************************************
*****************************************************
CREATE TABLE:
====== =====
Creates a table in a KeySpace.
Syntax
------
CREATE (TABLE | COLUMNFAMILY) <tablename> ('<column-definition>' , '<column-
definition>') (WITH <option> AND <option>)
Ex:
--
CREATE TABLE emp(
emp_id int PRIMARY KEY,
emp_name text,
emp_city text,
emp_sal varint,
emp_phone varint
);
verification:
------------
DESCRIBE COLUMNFAMILIES;
--------------------------------------------------------------------------------
----------------------------------------------------
ALTER TABLE:
===== =====
Modifies the column properties of a table.
Syntax
------
ALTER (TABLE | COLUMNFAMILY) <tablename> <instruction>
ALTER TABLE table name ADD newcolumn datatype;
ALTER table name DROP column name;
Ex:
--
ALTER TABLE emp ADD emp_email text;
ALTER TABLE emp DROP emp_email;
verification:
------------
DESCRIBE TABLE emp;
--------------------------------------------------------------------------------
----------------------------------------------------
DROP TABLE:
==== =====
Removes a table.
Syntax
------
DROP TABLE <tablename>
Ex:
--
DROP TABLE emp;
verification:
------------
DESCRIBE COLUMNFAMILIES;
--------------------------------------------------------------------------------
----------------------------------------------------
TRUNCATE TABLE
======== =====
Removes all the data from a table.
Syntax
------
TRUNCATE <tablename>
Ex:
--
TRUNCATE student;
verification:
------------
SELECT * FROM student;
--------------------------------------------------------------------------------
----------------------------------------------------
CREATE INDEX:
====== =====
Defines a new index on a single column of a table.
Syntax
------
CREATE INDEX <identifier> ON <tablename>
Ex:
--
CREATE INDEX name ON emp1 (emp_name);
--------------------------------------------------------------------------------
----------------------------------------------------
DROP INDEX:
==== =====
Deletes a named index.
Syntax
------
DROP INDEX <identifier>
Ex:
--
DROP INDEX name;
--------------------------------------------------------------------------------
----------------------------------------------------
BATCH STATEMENTS:
===== ==========
Executes multiple DML statements at once.
Syntax
------
BEGIN BATCH
<insert-stmt>/ <update-stmt>/ <delete-stmt>
APPLY BATCH
Ex:
--
BEGIN BATCH
INSERT INTO emp (emp_id, emp_city, emp_name, emp_phone, emp_sal)
values( 4,'Pune','rajeev',9848022331, 30000);
UPDATE emp SET emp_sal = 50000 WHERE emp_id =3;
DELETE emp_city FROM emp WHERE emp_id = 2;
APPLY BATCH;
verification:
------------
SELECT * FROM emp;
********************************************************************************
*****************************************************
CRUD OPERATIONS
********************************************************************************
*****************************************************
CREATE DATA:
====== ====
Adds columns for a row in a table.
Syntax
------
INSERT INTO <tablename> (<column1 name>, <column2 name>....) VALUES (<value1>,
<value2>....) USING <option>
Ex:
--
INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal) VALUES(1,'ram',
'Hyderabad', 9848022338, 50000);
INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal)
VALUES(2,'robin', 'Hyderabad', 9848022339, 40000);
INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal)
VALUES(3,'rahman', 'Chennai', 9848022330, 45000);
verification:
------------
SELECT * FROM emp;
--------------------------------------------------------------------------------
----------------------------------------------------
UPDATE DATA
====== ====
Updates a column of a row.
Syntax
------
UPDATE <tablename> SET <column name> = <new value> <column name> = <value>....
WHERE <condition>
Ex:
--
UPDATE emp SET emp_city='Delhi',emp_sal=50000 WHERE emp_id=2;
verification:
------------
SELECT * FROM emp;
--------------------------------------------------------------------------------
----------------------------------------------------
READ DATA:
==== ====
This clause reads data from a table.
Syntax
------
SELECT FROM <tablename>
SELECT FROM <table name> WHERE <condition>;
SELECT FROM <table name> WHERE <condition> ORDER BY <column>;
Ex:
--
SELECT * FROM emp;
SELECT emp_name, emp_sal from emp;
SELECT * FROM emp WHERE emp_sal=50000;
SELECT * FROM emp WHERE emp_sal=50000 ORDER BY sal;
--------------------------------------------------------------------------------
----------------------------------------------------
DELETE DATA:
====== ====
Deletes data from a table.
Syntax
------
DELETE FROM <identifier> WHERE <condition>;
Ex:
--
DELETE emp_sal FROM emp WHERE emp_id=3;
DELETE FROM emp WHERE emp_id=3;
verification:
------------
SELECT * FROM emp;
********************************************************************************
*****************************************************
CQL COLLECTION TYPES
********************************************************************************
*****************************************************
List
====
? the order of the elements is to be maintained, and
? a value is to be stored multiple times.
create
------
CREATE TABLE data(name text PRIMARY KEY, email list<text>);
inert
-----
INSERT INTO data(name, email) VALUES ('ramu',
['abc@gmail.com','cba@yahoo.com']);
update
------
UPDATE data SET email = email +['xyz@tutorialspoint.com'] where name = 'ramu';
verifiaction
------------
SELECT * FROM data;
--------------------------------------------------------------------------------
----------------------------------------------------
Set
===
Set is a data type that is used to store a group of elements. The elements of a
set will be returned in a sorted order.
create
------
CREATE TABLE data2 (name text PRIMARY KEY, phone set<varint>);
insert
------
INSERT INTO data2(name, phone)VALUES ('rahman', {9848022338,9848022339});
update
------
UPDATE data2 SET phone = phone + {9848022330} where name='rahman';
verifiaction
------------
SELECT * FROM data2;
--------------------------------------------------------------------------------
----------------------------------------------------
Map
===
Map is a data type that is used to store a key-value pair of elements.
create
------
CREATE TABLE data3 (name text PRIMARY KEY, address map<timestamp, text>);
insert
------
INSERT INTO data3 (name, address) VALUES ('robin', {'home' : 'hyderabad' ,
'office' : 'Delhi' } );
update
------
UPDATE data3 SET address = address+{'office':'mumbai'} WHERE name = 'robin';
verifiaction
------------
SELECT * FROM data3;
********************************************************************************
*****************************************************
CQL User-Defined Data Types
********************************************************************************
*****************************************************
CREATE TYPE:
====== ====
Creates a type in a KeySpace.
Syntax
------
CREATE TYPE <keyspace name > . <data typename> ( variable1, variable2).
Ex:
--
CREATE TYPE card_details (
num int,
pin int,
name text,
cvv int,
phone set<int>
);
verifiaction
------------
DESCRIBE TYPES;
--------------------------------------------------------------------------------
----------------------------------------------------
ALTER TYPE:
===== ====
Modifies the column properties of a type.
Syntax
------
ALTER TYPE typename ADD field_name field_type;
ALTER TYPE typename RENAME existing_name TO new_name;
Ex:
--
ALTER TYPE card_details ADD email text;
ALTER TYPE card_details RENAME email TO mail;
verifiaction
------------
DESCRIBE TYPE card_details;
--------------------------------------------------------------------------------
----------------------------------------------------
DROP TYPE:
==== ====
Removes a type.
Syntax
------
DROP TYPE <typename>
Ex:
--
DROP TYPE card;
verifiaction
------------
DESCRIBE TYPES;
------------
DESCRIBE TYPE card_details;
--------------------------------------------------------------------------------
----------------------------------------------------
DROP TYPE:
==== ====
Removes a type.
Syntax
------
DROP TYPE <typename>
Ex:
--
DROP TYPE card;
verifiaction
------------
DESCRIBE TYPES;
Ad

More Related Content

What's hot (20)

SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11SQL WORKSHOP::Lecture 11
SQL WORKSHOP::Lecture 11
Umair Amjad
 
Les09
Les09Les09
Les09
arnold 7490
 
MySQL partitions tutorial
MySQL partitions tutorialMySQL partitions tutorial
MySQL partitions tutorial
Giuseppe Maxia
 
Les11 Including Constraints
Les11 Including ConstraintsLes11 Including Constraints
Les11 Including Constraints
NETsolutions Asia: NSA – Thailand, Sripatum University: SPU
 
My sql presentation
My sql presentationMy sql presentation
My sql presentation
Nikhil Jain
 
Quick reference for mongo shell commands
Quick reference for mongo shell commandsQuick reference for mongo shell commands
Quick reference for mongo shell commands
Rajkumar Asohan, PMP
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
NETsolutions Asia: NSA – Thailand, Sripatum University: SPU
 
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
pitchaiah yechuri
 
Les09 Manipulating Data
Les09 Manipulating DataLes09 Manipulating Data
Les09 Manipulating Data
NETsolutions Asia: NSA – Thailand, Sripatum University: SPU
 
Boost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitionsBoost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitions
Giuseppe Maxia
 
Bibashsql
BibashsqlBibashsql
Bibashsql
Bkas CrEsta
 
Oracle training in hyderabad
Oracle training in hyderabadOracle training in hyderabad
Oracle training in hyderabad
Kelly Technologies
 
Les02
Les02Les02
Les02
Sudharsan S
 
Flashback (Practical Test)
Flashback (Practical Test)Flashback (Practical Test)
Flashback (Practical Test)
Anar Godjaev
 
Connor McDonald 11g for developers
Connor McDonald 11g for developersConnor McDonald 11g for developers
Connor McDonald 11g for developers
InSync Conference
 
Chapter08
Chapter08Chapter08
Chapter08
sasa_eldoby
 
Les12
Les12Les12
Les12
arnold 7490
 
Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL code
Simon Hoyle
 
DBMS lab manual
DBMS lab manualDBMS lab manual
DBMS lab manual
maha tce
 
Les13
Les13Les13
Les13
arnold 7490
 

Viewers also liked (15)

Presentation1
Presentation1Presentation1
Presentation1
Vijay Vakil
 
PASOS PREVIOS A NUESTRO PROYECTO
PASOS PREVIOS A NUESTRO PROYECTOPASOS PREVIOS A NUESTRO PROYECTO
PASOS PREVIOS A NUESTRO PROYECTO
Ignacio Rippa
 
The Best Restaurants in Los Angeles
The Best Restaurants in Los AngelesThe Best Restaurants in Los Angeles
The Best Restaurants in Los Angeles
49ThingstoDo
 
Elastic Plastic Foundation
Elastic Plastic FoundationElastic Plastic Foundation
Elastic Plastic Foundation
Miguelito Manya
 
Resume_Rishiraj Goswami
Resume_Rishiraj GoswamiResume_Rishiraj Goswami
Resume_Rishiraj Goswami
Rishiraj Goswami
 
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
Sumeet Gupta, CSP, SAFe Agilist (SA)
 
Preseentacion de administracion
Preseentacion de administracionPreseentacion de administracion
Preseentacion de administracion
arturo espino ortega
 
Garrapatas
GarrapatasGarrapatas
Garrapatas
Eduardo25guzz
 
Slideshare
SlideshareSlideshare
Slideshare
Ivan Martinez
 
16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян
AnastasiyaF
 
Хосписная помощь. Комплексный подход
Хосписная помощь. Комплексный подходХосписная помощь. Комплексный подход
Хосписная помощь. Комплексный подход
Фонд Вера
 
Media and Telecommunications Forum 2016
Media and Telecommunications Forum 2016Media and Telecommunications Forum 2016
Media and Telecommunications Forum 2016
Majed Garoub
 
Aapt UX Star Explorer - Presented by Aapt UX Learning
Aapt UX Star Explorer - Presented by Aapt UX LearningAapt UX Star Explorer - Presented by Aapt UX Learning
Aapt UX Star Explorer - Presented by Aapt UX Learning
Chetana Bhole
 
rumah sehat
rumah sehat rumah sehat
rumah sehat
siska18_syarifah
 
Prélèvements sociaux sur les revenus du patrimoine Français de Monaco
Prélèvements sociaux sur les revenus du patrimoine Français de MonacoPrélèvements sociaux sur les revenus du patrimoine Français de Monaco
Prélèvements sociaux sur les revenus du patrimoine Français de Monaco
Thomas Giaccardi
 
PASOS PREVIOS A NUESTRO PROYECTO
PASOS PREVIOS A NUESTRO PROYECTOPASOS PREVIOS A NUESTRO PROYECTO
PASOS PREVIOS A NUESTRO PROYECTO
Ignacio Rippa
 
The Best Restaurants in Los Angeles
The Best Restaurants in Los AngelesThe Best Restaurants in Los Angeles
The Best Restaurants in Los Angeles
49ThingstoDo
 
Elastic Plastic Foundation
Elastic Plastic FoundationElastic Plastic Foundation
Elastic Plastic Foundation
Miguelito Manya
 
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
SCRUMming “The Photosynthesis of Agile TREES (SCRUM Teams) for Software Deve...
Sumeet Gupta, CSP, SAFe Agilist (SA)
 
16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян16. Дзяржаўнасць усходніх славян
16. Дзяржаўнасць усходніх славян
AnastasiyaF
 
Хосписная помощь. Комплексный подход
Хосписная помощь. Комплексный подходХосписная помощь. Комплексный подход
Хосписная помощь. Комплексный подход
Фонд Вера
 
Media and Telecommunications Forum 2016
Media and Telecommunications Forum 2016Media and Telecommunications Forum 2016
Media and Telecommunications Forum 2016
Majed Garoub
 
Aapt UX Star Explorer - Presented by Aapt UX Learning
Aapt UX Star Explorer - Presented by Aapt UX LearningAapt UX Star Explorer - Presented by Aapt UX Learning
Aapt UX Star Explorer - Presented by Aapt UX Learning
Chetana Bhole
 
Prélèvements sociaux sur les revenus du patrimoine Français de Monaco
Prélèvements sociaux sur les revenus du patrimoine Français de MonacoPrélèvements sociaux sur les revenus du patrimoine Français de Monaco
Prélèvements sociaux sur les revenus du patrimoine Français de Monaco
Thomas Giaccardi
 
Ad

Similar to Quick reference for cql (20)

Quick reference for spark sql
Quick reference for spark sqlQuick reference for spark sql
Quick reference for spark sql
Rajkumar Asohan, PMP
 
Sql2
Sql2Sql2
Sql2
Breme ArunPrasath
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programs
mcclintick
 
Oracle 12c: Database Table Rows Archiving testing
Oracle 12c: Database Table Rows Archiving testingOracle 12c: Database Table Rows Archiving testing
Oracle 12c: Database Table Rows Archiving testing
Monowar Mukul
 
Quick reference for Grafana
Quick reference for GrafanaQuick reference for Grafana
Quick reference for Grafana
Rajkumar Asohan, PMP
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
Sandish Kumar H N
 
Hadoop on aws amazon
Hadoop on aws amazonHadoop on aws amazon
Hadoop on aws amazon
Sandish Kumar H N
 
Nls
NlsNls
Nls
Aonjai Khemsuk
 
ZFINDALLZPROGAM
ZFINDALLZPROGAMZFINDALLZPROGAM
ZFINDALLZPROGAM
Jay Dalwadi
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application Development
Saurabh K. Gupta
 
Casnewb
CasnewbCasnewb
Casnewb
S Beng Lim
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PgDay.Seoul
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
Jussi Pohjolainen
 
Alv barra her
Alv barra herAlv barra her
Alv barra her
Universidad de Trujillo
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humans
Craig Kerstiens
 
12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax
Connor McDonald
 
SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所
Hiroshi Sekiguchi
 
Oracle12c For Developers
Oracle12c For DevelopersOracle12c For Developers
Oracle12c For Developers
Alex Nuijten
 
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Oracle12 for Developers - Oracle OpenWorld Preview AMISOracle12 for Developers - Oracle OpenWorld Preview AMIS
Oracle12 for Developers - Oracle OpenWorld Preview AMIS
Getting value from IoT, Integration and Data Analytics
 
Les01
Les01Les01
Les01
arnold 7490
 
Alvedit programs
Alvedit programsAlvedit programs
Alvedit programs
mcclintick
 
Oracle 12c: Database Table Rows Archiving testing
Oracle 12c: Database Table Rows Archiving testingOracle 12c: Database Table Rows Archiving testing
Oracle 12c: Database Table Rows Archiving testing
Monowar Mukul
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application Development
Saurabh K. Gupta
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PgDay.Seoul
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
Jussi Pohjolainen
 
Postgres performance for humans
Postgres performance for humansPostgres performance for humans
Postgres performance for humans
Craig Kerstiens
 
12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax
Connor McDonald
 
SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所SQLチューニング総合診療Oracle CloudWorld出張所
SQLチューニング総合診療Oracle CloudWorld出張所
Hiroshi Sekiguchi
 
Oracle12c For Developers
Oracle12c For DevelopersOracle12c For Developers
Oracle12c For Developers
Alex Nuijten
 
Ad

Recently uploaded (20)

Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
Metamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative JourneyMetamorphosis: Life's Transformative Journey
Metamorphosis: Life's Transformative Journey
Arshad Shaikh
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACYUNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
UNIT 3 NATIONAL HEALTH PROGRAMMEE. SOCIAL AND PREVENTIVE PHARMACY
DR.PRISCILLA MARY J
 

Quick reference for cql

  • 1. ******************************************************************************** ***************************************************** CASSANDRA BASICS - SHELL COMMANDS ******************************************************************************** ***************************************************** HELP: ==== Displays help topics for all cqlsh commands. Ex: -- HELP -------------------------------------------------------------------------------- ---------------------------------------------------- CAPTURE: ======= Captures the output of a command and adds it to a file. Ex: -- CAPTURE '/home/hadoop/CassandraProgs/Outputfile'; verification: ------------ CAPTURE '/home/hadoop/CassandraProgs/Outputfile'; select * from emp; CAPTURE OFF; -------------------------------------------------------------------------------- ---------------------------------------------------- CONSISTENCY: =========== Shows the current consistency level, or sets a new consistency level. Ex: -- CONSISTENCY -------------------------------------------------------------------------------- ---------------------------------------------------- COPY: ==== Copies data to and from Cassandra. Ex: -- COPY emp (emp_id, emp_city, emp_name, emp_phone, emp_sal) TO ‘myfile‘; -------------------------------------------------------------------------------- ---------------------------------------------------- DESCRIBE: ========= Describes the current cluster of Cassandra and its objects. Ex: -- DESCRIBE CLUSTER; DESCRIBE KEYSPACES; DESCRIBE TABLES; DESCRIBE TABLE emp; DESCRIBE COLUMNFAMILIES; DESCRIBE TYPES; DESCRIBE TYPE card_details; -------------------------------------------------------------------------------- ---------------------------------------------------- EXPAND: ======
  • 2. Expands the output of a query vertically. Ex -- EXPAND ON EXPAND OFF verificarion: ------------ EXPAND ON select * from emp; EXPAND OFF -------------------------------------------------------------------------------- ---------------------------------------------------- EXIT: ==== Using this command, you can terminate cqlsh. -------------------------------------------------------------------------------- ---------------------------------------------------- PAGING: ====== Enables or disables query paging. -------------------------------------------------------------------------------- ---------------------------------------------------- SHOW: ==== Displays the details of current cqlsh session such as Cassandra version, host, or data type assumptions. Ex: -- SHOW HOST; SHOW VERSION; -------------------------------------------------------------------------------- ---------------------------------------------------- SOURCE: ====== Executes a file that contains CQL statements. Ex: -- SOURCE '/home/hadoop/CassandraProgs/inputfile'; -------------------------------------------------------------------------------- ---------------------------------------------------- TRACING: ======= Enables or disables request tracing. ******************************************************************************** ***************************************************** KEYSPACE OPERATIONS ******************************************************************************** ***************************************************** CREATE KEYSPACE: ====== ======== Creates a KeySpace in Cassandra. USE: === Connects to a created KeySpace. Syntax ------ CREATE KEYSPACE <identifier> WITH <properties>
  • 3. CREATE KEYSPACE "KeySpace Name" WITH replication = {'class': ‘Strategy name‘, 'replication_factor' : ‘No.Of replicas‘}; CREATE KEYSPACE "KeySpace Name" WITH replication = {'class': ‘Strategy name‘, 'replication_factor' : ‘No.Of replicas‘} AND DURABLE_WRITES = ‘Boolean value‘; USE <identifier> Ex: --- USE tutorialspoint; CREATE KEYSPACE tutorialspoint WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3}; CREATE KEYSPACE test WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 3 } AND DURABLE_WRITES = false; verification: ------------ DESCRIBE KEYSPACES; SELECT * FROM system.schema_keyspaces; -------------------------------------------------------------------------------- ---------------------------------------------------- ALTER KEYSPACE: ===== ======== Changes the properties of a KeySpace. Syntax ------ ALTER KEYSPACE <identifier> WITH <properties> ALTER KEYSPACE "KeySpace Name" WITH REPLICATION = {'class': ‘Strategy name‘, 'replication_factor' : ‘No.Of replicas‘}; ALTER KEYSPACE "KeySpace Name" WITH REPLICATION = {'class': ‘Strategy name‘, 'replication_factor' : ‘No.Of replicas‘} AND DURABLE_WRITES = ‘Boolean value‘; Ex: -- ALTER KEYSPACE tutorialspoint WITH REPLICATION = {'class':'NetworkTopologyStrategy', 'replication_factor' : 3}; ALTER KEYSPACE test WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'datacenter1' : 3} AND DURABLE_WRITES = true; verification: ------------ SELECT * FROM system.schema_keyspaces; -------------------------------------------------------------------------------- ---------------------------------------------------- DROP KEYSPACE: ==== ======== Removes a KeySpace Syntax ------ DROP KEYSPACE <identifier> DROP KEYSPACE "KeySpace name" Ex: -- DROP KEYSPACE tutorialspoint; verification: ------------ DESCRIBE KEYSPACES; ******************************************************************************** ***************************************************** TABLE OPERATIONS ********************************************************************************
  • 4. ***************************************************** CREATE TABLE: ====== ===== Creates a table in a KeySpace. Syntax ------ CREATE (TABLE | COLUMNFAMILY) <tablename> ('<column-definition>' , '<column- definition>') (WITH <option> AND <option>) Ex: -- CREATE TABLE emp( emp_id int PRIMARY KEY, emp_name text, emp_city text, emp_sal varint, emp_phone varint ); verification: ------------ DESCRIBE COLUMNFAMILIES; -------------------------------------------------------------------------------- ---------------------------------------------------- ALTER TABLE: ===== ===== Modifies the column properties of a table. Syntax ------ ALTER (TABLE | COLUMNFAMILY) <tablename> <instruction> ALTER TABLE table name ADD newcolumn datatype; ALTER table name DROP column name; Ex: -- ALTER TABLE emp ADD emp_email text; ALTER TABLE emp DROP emp_email; verification: ------------ DESCRIBE TABLE emp; -------------------------------------------------------------------------------- ---------------------------------------------------- DROP TABLE: ==== ===== Removes a table. Syntax ------ DROP TABLE <tablename> Ex: -- DROP TABLE emp; verification: ------------ DESCRIBE COLUMNFAMILIES; -------------------------------------------------------------------------------- ---------------------------------------------------- TRUNCATE TABLE ======== =====
  • 5. Removes all the data from a table. Syntax ------ TRUNCATE <tablename> Ex: -- TRUNCATE student; verification: ------------ SELECT * FROM student; -------------------------------------------------------------------------------- ---------------------------------------------------- CREATE INDEX: ====== ===== Defines a new index on a single column of a table. Syntax ------ CREATE INDEX <identifier> ON <tablename> Ex: -- CREATE INDEX name ON emp1 (emp_name); -------------------------------------------------------------------------------- ---------------------------------------------------- DROP INDEX: ==== ===== Deletes a named index. Syntax ------ DROP INDEX <identifier> Ex: -- DROP INDEX name; -------------------------------------------------------------------------------- ---------------------------------------------------- BATCH STATEMENTS: ===== ========== Executes multiple DML statements at once. Syntax ------ BEGIN BATCH <insert-stmt>/ <update-stmt>/ <delete-stmt> APPLY BATCH Ex: -- BEGIN BATCH INSERT INTO emp (emp_id, emp_city, emp_name, emp_phone, emp_sal) values( 4,'Pune','rajeev',9848022331, 30000); UPDATE emp SET emp_sal = 50000 WHERE emp_id =3; DELETE emp_city FROM emp WHERE emp_id = 2; APPLY BATCH; verification: ------------ SELECT * FROM emp; ********************************************************************************
  • 6. ***************************************************** CRUD OPERATIONS ******************************************************************************** ***************************************************** CREATE DATA: ====== ==== Adds columns for a row in a table. Syntax ------ INSERT INTO <tablename> (<column1 name>, <column2 name>....) VALUES (<value1>, <value2>....) USING <option> Ex: -- INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal) VALUES(1,'ram', 'Hyderabad', 9848022338, 50000); INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal) VALUES(2,'robin', 'Hyderabad', 9848022339, 40000); INSERT INTO emp (emp_id, emp_name, emp_city, emp_phone, emp_sal) VALUES(3,'rahman', 'Chennai', 9848022330, 45000); verification: ------------ SELECT * FROM emp; -------------------------------------------------------------------------------- ---------------------------------------------------- UPDATE DATA ====== ==== Updates a column of a row. Syntax ------ UPDATE <tablename> SET <column name> = <new value> <column name> = <value>.... WHERE <condition> Ex: -- UPDATE emp SET emp_city='Delhi',emp_sal=50000 WHERE emp_id=2; verification: ------------ SELECT * FROM emp; -------------------------------------------------------------------------------- ---------------------------------------------------- READ DATA: ==== ==== This clause reads data from a table. Syntax ------ SELECT FROM <tablename> SELECT FROM <table name> WHERE <condition>; SELECT FROM <table name> WHERE <condition> ORDER BY <column>; Ex: -- SELECT * FROM emp; SELECT emp_name, emp_sal from emp; SELECT * FROM emp WHERE emp_sal=50000; SELECT * FROM emp WHERE emp_sal=50000 ORDER BY sal; -------------------------------------------------------------------------------- ---------------------------------------------------- DELETE DATA:
  • 7. ====== ==== Deletes data from a table. Syntax ------ DELETE FROM <identifier> WHERE <condition>; Ex: -- DELETE emp_sal FROM emp WHERE emp_id=3; DELETE FROM emp WHERE emp_id=3; verification: ------------ SELECT * FROM emp; ******************************************************************************** ***************************************************** CQL COLLECTION TYPES ******************************************************************************** ***************************************************** List ==== ? the order of the elements is to be maintained, and ? a value is to be stored multiple times. create ------ CREATE TABLE data(name text PRIMARY KEY, email list<text>); inert ----- INSERT INTO data(name, email) VALUES ('ramu', ['[email protected]','[email protected]']); update ------ UPDATE data SET email = email +['[email protected]'] where name = 'ramu'; verifiaction ------------ SELECT * FROM data; -------------------------------------------------------------------------------- ---------------------------------------------------- Set === Set is a data type that is used to store a group of elements. The elements of a set will be returned in a sorted order. create ------ CREATE TABLE data2 (name text PRIMARY KEY, phone set<varint>); insert ------ INSERT INTO data2(name, phone)VALUES ('rahman', {9848022338,9848022339}); update ------ UPDATE data2 SET phone = phone + {9848022330} where name='rahman'; verifiaction ------------ SELECT * FROM data2; --------------------------------------------------------------------------------
  • 8. ---------------------------------------------------- Map === Map is a data type that is used to store a key-value pair of elements. create ------ CREATE TABLE data3 (name text PRIMARY KEY, address map<timestamp, text>); insert ------ INSERT INTO data3 (name, address) VALUES ('robin', {'home' : 'hyderabad' , 'office' : 'Delhi' } ); update ------ UPDATE data3 SET address = address+{'office':'mumbai'} WHERE name = 'robin'; verifiaction ------------ SELECT * FROM data3; ******************************************************************************** ***************************************************** CQL User-Defined Data Types ******************************************************************************** ***************************************************** CREATE TYPE: ====== ==== Creates a type in a KeySpace. Syntax ------ CREATE TYPE <keyspace name > . <data typename> ( variable1, variable2). Ex: -- CREATE TYPE card_details ( num int, pin int, name text, cvv int, phone set<int> ); verifiaction ------------ DESCRIBE TYPES; -------------------------------------------------------------------------------- ---------------------------------------------------- ALTER TYPE: ===== ==== Modifies the column properties of a type. Syntax ------ ALTER TYPE typename ADD field_name field_type; ALTER TYPE typename RENAME existing_name TO new_name; Ex: -- ALTER TYPE card_details ADD email text; ALTER TYPE card_details RENAME email TO mail; verifiaction
  • 9. ------------ DESCRIBE TYPE card_details; -------------------------------------------------------------------------------- ---------------------------------------------------- DROP TYPE: ==== ==== Removes a type. Syntax ------ DROP TYPE <typename> Ex: -- DROP TYPE card; verifiaction ------------ DESCRIBE TYPES;
  • 10. ------------ DESCRIBE TYPE card_details; -------------------------------------------------------------------------------- ---------------------------------------------------- DROP TYPE: ==== ==== Removes a type. Syntax ------ DROP TYPE <typename> Ex: -- DROP TYPE card; verifiaction ------------ DESCRIBE TYPES;