Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

sql
query
structure
database
schema

What is SQL?

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Structured Query Language (SQL) is a standard data-oriented language which is primarily used to store, retrieve and manipulate data using simple code snippets, called queries, in an RDBMS (relational database management system).

The data is stored in the RDBMS in a structured way, where there exist relations between the different entities and variables in the data. These relations are defined by the database schema which does not only specify the relation between various entities but also the organization of data associated with those entities in the database.

svg viewer

SQL statements

Since SQL can be used to store, retrieve as well as manipulate the data in an RDBMS, it comes packed with many statements that are used to achieve those operations. Given is a list of some commonly used SQL statements:

svg viewer

Example

Given below is an example. You first create a table, insert some data in it and then view all the data in that table.

-- Creating a table in database

-- CREATE TABLE <Table name>
CREATE TABLE Persons (
    -- <Variable name> <Variable type>
    FirstName 	varchar(255),
    LastName 		varchar(255),
    Country 		varchar(255)
);

-- Inserting 
INSERT INTO
  -- <Table name>
  Persons 
    -- <Variable names>
    (FirstName, LastName, Country) 
  VALUES
    -- <Variable values>
    ('Faysal', 'Herminio', 'Tanzania'),
    ('Bertha', 'Cleisthenes', 'Spain'),
    ('Jonatan', 'Netanel', 'United States');

-- Selecting everything we stored in the table to view
SELECT *
FROM Persons;

RELATED TAGS

sql
query
structure
database
schema
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring