Group 6 Structured Query Language 2021 Final
Group 6 Structured Query Language 2021 Final
GROUP SIX
27.02.21
Group Members
• Query
• Insert
• Update on a database
• Modify data
• Allows us to interface with databases
ADVANTAGES AND DISADVANTAGES OF SQL
• ADVANTAGES • DISADVANTAGES
• High Speed - its easy to retrieve records from a • Its platform dependent
database.
• Occupies some space i.e extra memory location for
• No coding needed - doesn’t require substantial each record.
amount of code to manage database.
• It is command a command based language
• Adheres to long established and defined Standards
(ISO, ANSI)
• Portable – can be used in laptops, PCs server and
even mobile phones
• ACID- Atomicity, Consistency, Isolation, Durability
COMMON RELATIONAL DATABASE MANAGEMENT
SYSTEMS THAT USE SQL
• Oracle
• Sybase
• Microsoft SQL Server
• Access
• Ingres
COMMON COMMANDS IN
SQL
• CREATE DATABASE: to create a database
• CREATE TABLE: to create tables
• SELECT: to find/extract some data from a database
• UPDATE: to make adjustments and edit data
• DELETE: to delete some data.
SQL
SUBLANGUAGES
SQL consists of five principal sublanguages as presented below:
• Data Definition Language
• Data Query Language
• Data Manipulation Language
• Data Control Language
• Transaction Control Language
SQL Sublanguages
SQL SUBLANGUAGES
DDL (DATA DEFINITION LANGUAGE)
• It is used to define data structures stored in the database. DDL statements allow to
create, modify or destroy individual database objects
• Examples of DDL commands:
• CREATE– is used to create the database or its objects (like table, index, function,
views, store procedure and triggers).
Syntax:
CREATE TABLE TABLE_NAME (COLUMN_NAME DATATYPES[,....]);
Example:
CREATE TABLE EMPLOYEE(Name VARCHAR2(20), Email VARCHAR2(100), DOB DATE);
SQL SUBLANGUAGES
DDL (DATA DEFINITION LANGUAGE)
• Examples of DDL commands (cont):
• DROP – is used to delete objects from the database.
Syntax
DROP TABLE ;
Example
DROP TABLE EMPLOYEE;
SQL SUBLANGUAGES
DDL (DATA DEFINITION LANGUAGE)
• Examples of DDL commands (continued):
• ALTER - is used to alter the structure of the database. Below we will look at altering a table
• Example of DQL:
• SELECT – is used to retrieve data from a database.
FROM TABLES
WHERE conditions;
EXAMPLE
SELECT FIRSTNAME
FROM STUDENTBIO
• https://www.w3schools.com/sql/sql_create_table.asp
• https://www.w3schools.com/sql/sql_create_table.asp
• https://www.khanacademy.org/computing/computer-programming/sql