Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

What is the best way to learn SQL for data analyst?

Fundamental SQL Statements

  1. Create: creating a basic table involves naming the table and defining its columns and each column’s data type.
    Syntax :
    CREATE TABLE “table_name”(
    “column 1” “data type for column 1” [column 1 constraint(s)],
    “column 2” “data type for column 2” [column 2 constraint(s)],
    ……
    “column n”
    [“table constraint(s)”]);

Example :
create table Engineer_table (
Cust_id int,
First_name varchar,
Last_name varchar,
age int,
email_id varchar);
)

Constraints define the type of data which will be entered into the table column.
Now I am defining the type of Constraints, so please look below for a better understanding of constraints:

  1. NOT NULL Constraint: Ensures that a column cannot have NULL value.
  2. DEFAULT Constraint: Provides a default value for a column when none is specified.
  3. UNIQUE Constraint: Ensures that all values in a column are different.
  4. CHECK Constraint: Makes sure that all values in a column satisfy certain criteria.
  5. Primary Key Constraint: Used to uniquely identify a row in the table.
  6. Foreign Key Constraint: used to ensure referential integrity of the data.

Keys

  • A primary key is used to uniquely identify each row in a table and consist of one or more columns on a table.
  • When multiple columns are used as a primary key, they are called a composite key.
  • A foreign key is a column( or columns) that references a column (most often the primary key) of another table.

2. INSERT: The INSERT INTO statement is used to add new records into a database table.

Syntax:
INSERT INTO “table_name” (“column1″,”column2”,…) VALUES(“value1″,”value2”,…);

Example:
Single row (without column names specified)
INSERT INTO customer_table
VALUES(1, ‘chandan’,’Kumar’,23,’chandan@devopsschool.com’);

Single row (with column name specified)
INSERT INTO customer_table(cust_id,first_name,last_name,age,email_id)
VALUES(2, ‘Ajay’,’Kumar’,24,’ajay@devopsschool.com’);

Multiple rows
INSERT INTO customer_table
VALUES (1,’ck’,’dk’,35,’az@xyz.com’),
(2,’ak’,’pj’,36,’hg@xyz.com’);


Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.