Skip to main content

Command Palette

Search for a command to run...

SQL, the Structured Query Language

Published
2 min read
SQL, the Structured Query Language

As a developer, you will work with the database, most of them will be Relational database and some, well they won’t be( for that you will have to learn more about the NoSql [not only SQL]).

Structural Query Language by Charles Kasasira

A relational database is a database structured to recognize relations between stored items of information.

So, What is SQL

SQL (Structured Query Language) is a tool for interacting with Relational Database Management Systems(RDBMS). It is a reliable and efficient language used for communicating with the database.

some of the most common database servers include:

- MySQL

- Oracle

- Ms Access

Why bother with SQL

-allows us to manage(create, rename, delete) databases.

-manage databases tables

–Large amount of data is retrieved quickly and efficiently.

-perform operations like Insertion, deletion, manipulation of data

“ What about NoSQL?-conversation for later “.

Database principles and use

What is a good database!

A good database should be:

-concurrent:Multiple users can safely read and edit database entries simultaneously.

-reliable:Relational databases formalize and can enforce concepts of “tidy” data.

-scalable:Very large tables can be read, searched, and merged quickly.

[Most used SQL commands](https://www.w3schools.com/sql/sql_syntax.asp)

  • SELECT — extracts data from a database
  • UPDATE — updates data in a database
  • DELETE — deletes data from a database
  • INSERT INTO — inserts new data into a database
  • CREATE DATABASE — creates a new database
  • ALTER DATABASE — modifies a database
  • CREATE TABLE — creates a new table
  • ALTER TABLE — modifies a table
  • DROP TABLE — deletes a table
  • CREATE INDEX — creates an index (search key)
  • DROP INDEX — deletes an index

CONSTRAINTS(limitations for the data)

1.Not Null

2.unique

3.Primary key

4.Foreign key

5.Default

6.Check

7.Create Index

Check constraint

Create index

SQL JOIN

A SQL Join statement is used to combine data or rows from two or more tables based on a common field between them

Types of joins

-inner join

-full join

-left join

-right join

I will have to make a full article about the joins, inform me if you love it.

More from this blog

C

Charles Kasasira - Fullstack developer

21 posts

Software engineer aiming to design and develop experiences that make people's lives simple.