0% found this document useful (0 votes)
5 views2 pages

Formatted DBMS Syntax Guide

This document serves as a beginner to intermediate guide on Database Management Systems (DBMS), defining key concepts such as databases, DBMS, tables, primary keys, and foreign keys. It provides basic SQL syntax for operations like creating tables, inserting, updating, and deleting records, as well as performing queries and joins. Additionally, it includes example SQL queries to illustrate these concepts in practice.

Uploaded by

zubair ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Formatted DBMS Syntax Guide

This document serves as a beginner to intermediate guide on Database Management Systems (DBMS), defining key concepts such as databases, DBMS, tables, primary keys, and foreign keys. It provides basic SQL syntax for operations like creating tables, inserting, updating, and deleting records, as well as performing queries and joins. Additionally, it includes example SQL queries to illustrate these concepts in practice.

Uploaded by

zubair ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Database Management System (DBMS) – Beginner to Intermediate

Guide

1. Basic Definitions
- Database: An organized collection of data stored electronically.

- DBMS: A software system that enables users to define, create, maintain, and control
access to databases.

- Table: A set of data elements organized using a model of vertical columns and
horizontal rows.

- Primary Key: A unique identifier for a record in a table.

- Foreign Key: A field that links one table to another.

- Query: A request for data or information from a database.

- Schema: The structure that defines the organization of data in a database.

2. Basic SQL Syntax (From CREATE to INNER JOIN)


- CREATE TABLE table_name (column1 datatype, column2 datatype, ...);

- INSERT INTO table_name (column1, column2) VALUES (value1, value2);

- SELECT * FROM table_name;

- SELECT column1, column2 FROM table_name;

- UPDATE table_name SET column1 = value1 WHERE condition;

- DELETE FROM table_name WHERE condition;

- ALTER TABLE table_name ADD column_name datatype;

- DROP TABLE table_name;

- SELECT * FROM table1 INNER JOIN table2 ON table1.id = table2.id;

- SELECT * FROM table_name ORDER BY column_name ASC/DESC;

- SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name;


- SELECT column_name FROM table_name WHERE condition LIMIT number;

- UPDATE table_name SET column_name = value WHERE condition;

- INNER JOIN is used to return rows that have matching values in both tables.

- ON keyword is used in JOINs to specify the matching column.

3. Example SQL Queries


Create a table
CREATE TABLE Students (ID INT PRIMARY KEY, Name VARCHAR(50), Age
INT);

Insert a record
INSERT INTO Students (ID, Name, Age) VALUES (1, 'Ali', 20);

Fetch all records


SELECT * FROM Students;

Update record
UPDATE Students SET Age = 21 WHERE ID = 1;

Delete a record
DELETE FROM Students WHERE ID = 1;

Add a new column


ALTER TABLE Students ADD Email VARCHAR(100);

Inner join two tables


SELECT S.Name, E.Course FROM Students S INNER JOIN Enrollments E ON S.ID =
E.StudentID;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy