Following MySQL Here....
SQL Basics and Database Concepts
What is SQL?
SQL (Structured Query Language) is a standard programming language used to manage and manipulate relational databases. SQL enables you to create, retrieve, update, and delete data from databases.
Key Concepts in SQL
Database
A database is a collection of organized data, typically stored in tables, that can be easily accessed, managed, and updated.
Table
A table is a collection of related data stored in rows and columns. Each table is identified by a name, and each row in the table is a record containing data.
Record
A record is a row in a table, containing specific data for the columns (fields) in that table. For example, in the Customers table, each row represents a customer, with columns for CustomerID, CustomerName, ContactName, Address, etc.
Column
A column is a field in a table that holds a specific type of data (e.g., name, address, age).
Some of The Most Important SQL Commands
-- Step 1: Select the database
USE niteshsynergy;
-- Step 2: Create the Customers table
CREATE TABLE IF NOT EXISTS Customers (
CustomerID INT PRIMARY KEY,
CustomerName VARCHAR(100),
ContactName VARCHAR(100),
Address VARCHAR(150),
City VARCHAR(50),
PostalCode VARCHAR(20),
Country VARCHAR(50)
);
-- Step 3: Insert the data
INSERT INTO Customers (CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES
(1, 'Alfreds Futterkiste', 'Maria Anders', 'Obere Str. 57', 'Berlin', '12209', 'Germany'),
(2, 'Ana Trujillo Emparedados y helados', 'Ana Trujillo', 'Avda. de la Constitución 2222', 'México D.F.', '05021', 'Mexico'),
(3, 'Antonio Moreno Taquería', 'Antonio Moreno', 'Mataderos 2312', 'México D.F.', '05023', 'Mexico'),
(4, 'Around the Horn', 'Thomas Hardy', '120 Hanover Sq.', 'London', 'WA1 1DP', 'UK'),
(5, 'Berglunds snabbköp', 'Christina Berglund', 'Berguvsvägen 8', 'Luleå', 'S-958 22', 'Sweden');