Master SQL Server Basics: From SELECT to DELETE with Real Examples
This article walks through the fundamentals of SQL Server, covering installation, core SQL concepts, DML and DDL commands, and detailed examples of SELECT, INSERT, UPDATE, and DELETE statements with accompanying syntax illustrations to help beginners master relational database operations.
SQL Server Basic Usage
First, install SQL Server; the standard or enterprise edition is recommended over the Express edition.
SQL Basic Syntax Introduction
SQL (Structured Query Language) is the ANSI standard language for accessing and manipulating relational databases.
What is SQL?
SQL stands for Structured Query Language.
It enables us to access databases.
It is an ANSI standard computer language.
SQL can be used with database systems such as MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, MySQL, and others.
What can we do with SQL?
Query data from databases. Insert new records. Update existing data. Delete records. Create new databases and tables. Create stored procedures and views. Set permissions on tables, procedures, and views.
RDBMS Overview
RDBMS stands for Relational Database Management System. Data is stored in tables composed of rows and columns.
Basic Syntax
SQL is case‑insensitive. It is divided into Data Manipulation Language (DML) and Data Definition Language (DDL).
DML (Data Manipulation Language)
SELECT – retrieve data from tables
INSERT INTO – add new rows
UPDATE – modify existing rows
DELETE – remove rows
DDL (Data Definition Language)
CREATE DATABASE – create a new database
ALTER DATABASE – modify a database
CREATE TABLE – create a new table
ALTER TABLE – change a table
DROP TABLE – delete a table
CREATE INDEX – create an index
DROP INDEX – delete an index
SELECT Statement Basics
The SELECT statement is used most frequently for querying data.
Basic syntax illustration:
Example: query the ID column from the teacher table.
Common SELECT clauses:
WHERE – filter rows
AND / OR – combine multiple conditions
ORDER BY – sort results (ASC by default, DESC for descending)
TOP – limit number or percentage of rows returned
LIKE – pattern matching
BETWEEN – select values within a range
SELECT DISTINCT – return unique values
Wildcards (% , _ , [charlist] , [^charlist]) – used with LIKE
Code example illustration:
INSERT INTO Basics
The INSERT INTO statement adds new rows to a table.
Example:
INSERT INTO is frequently used; the simplest form is shown above.
UPDATE Statement
The UPDATE statement modifies data in a table.
Example:
DELETE Statement
The DELETE statement removes rows from a table.
Example:
Practicing these basic database operations regularly is essential to develop speed and proficiency.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
