MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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’);


Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in provides the perfect two-wheeler for every occasion—daily commuting, weekend escapes, tourist exploration, or test-riding your dream bike. Simplify your mobility with us!

Related Posts

Python Tutorials: Database operations using python – mysql

This tutorial connects Python to MySQL with the official mysql-connector-python driver and runs the full set of CRUD operations: create a database and table, then insert, read,…

Read More

Rundeck Database Migration From H2 to MySql and postgresql

This guide moves Rundeck off its embedded H2 database and onto MySQL or PostgreSQL, which is what you should use in production. The steps above set up…

Read More

MySql Backup and Restore – A Complete Guide

MySQL logical backups are made with mysqldump, which writes a database out as a plain SQL file, and restored with the mysql client, which runs that file…

Read More

How to Reset or Recover Forgotten mySql root Password

To reset a forgotten MySQL or MariaDB root password, stop the server, restart it with grant checks turned off (skip-grant-tables), set a new password with ALTER USER,…

Read More

Import all MySQL databases at one time in seperate file for Backup

This page shows two ways to back up MySQL: with mysqldump –all-databases you get one large file, and with a shell loop you get one dump file…

Read More

Team Foundation Server 2015 Installation Guide (SQL Express + Update 3)

Install Team Foundation Server 2015 using the original Microsoft download paths, with clear guidance for online, offline, and ISO-based setup. This revised guide also includes an installation workflow, command example, and practical pitfalls to avoid.

Read More