Giter Club home page Giter Club logo

sql-info's Introduction

SQL

Q A
First appeared 1974
Paradigm Declarative
Family Query language
Typing discipline Static, strong
Designed by Donald D. Chamberlin, Raymond F. Boyce

Examples:

Database creation:

CREATE DATABASE mydatabase;

Table creation:

CREATE TABLE users (
  id INT PRIMARY KEY,
  username VARCHAR(50),
  email VARCHAR(100)
);

Data Insertion:

INSERT INTO users (id, username, email)
VALUES (1, 'john_doe', '[email protected]');

Data Querying:

SELECT * FROM users;

Data Filtering:

SELECT * FROM users WHERE username = 'john_doe';

Data Sorting and Limiting:

SELECT * FROM users ORDER BY username ASC LIMIT 10;

Data Aggregation:

SELECT COUNT(*) FROM users; # Use aggregate functions like COUNT, SUM, AVG, MIN, and MAX for data analysis

Data Updating:

UPDATE users SET email = '[email protected]' WHERE id = 1;

Data Deletion:

DELETE FROM users WHERE id = 1;

Table Joining (used to combine rows from two or more tables based on a related column):

SELECT users.username, orders.order_id
FROM users
INNER JOIN orders ON users.id = orders.user_id;

Table Editing:

ALTER TABLE table_name ADD column_name datatype;

Table Deletion:

DROP TABLE table_name;

List Databases:

SHOW DATABASES; # Displays a list of all the available databases

SHOW SCHEMAS; # an alternate for the SHOW DATABASES statement

Use Database:

USE database_name; # Specifies which database to use

List Tables:

SHOW TABLES; # Displays a list of tables in the current database

More at https://www.w3schools.com/sql/sql_ref_mysql.asp

sql-info's People

Contributors

stepanenko avatar dependabot[bot] avatar

Stargazers

Roman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.