[go: up one dir, main page]

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

Dbms SQL Revision

The document provides a comprehensive overview of database management and SQL, defining key concepts such as databases, DBMS, and types of keys. It outlines SQL categories, data types, constraints, and includes examples of SQL commands for creating and manipulating a database. Additionally, it offers a final revision checklist to reinforce understanding of the material covered.

Uploaded by

nxlesh6
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)
20 views2 pages

Dbms SQL Revision

The document provides a comprehensive overview of database management and SQL, defining key concepts such as databases, DBMS, and types of keys. It outlines SQL categories, data types, constraints, and includes examples of SQL commands for creating and manipulating a database. Additionally, it offers a final revision checklist to reinforce understanding of the material covered.

Uploaded by

nxlesh6
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 & SQL - Full Exam Revision

Part 1: Database Management

What is a Database?

A database is an organized collection of data.

What is DBMS?

DBMS (Database Management System) is software to manage databases (e.g., MySQL, Oracle).

Types of Keys:

- Candidate Key: Potential unique identifiers.

- Primary Key: Chosen candidate key.

- Alternate Key: Other candidate keys not chosen.

- Foreign Key: Refers to primary key in another table.

Part 2: SQL (Structured Query Language)

SQL Categories:

- DDL (Data Definition): CREATE, ALTER, DROP

- DML (Data Manipulation): INSERT, UPDATE, DELETE

- DQL (Query Language): SELECT

Data Types:

- CHAR(n), VARCHAR(n), INT, FLOAT, DATE

Constraints:

- NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY

Part 3: SQL Commands with Examples

CREATE DATABASE School;

USE School;

CREATE TABLE Students (

RollNo INT PRIMARY KEY,

Name VARCHAR(50),

Age INT,
Grade CHAR(2)

);

SHOW TABLES;

DESCRIBE Students;

INSERT INTO Students VALUES (1, 'Rahul', 16, 'A1');

SELECT * FROM Students;

UPDATE Students SET Grade = 'B2' WHERE RollNo = 1;

DELETE FROM Students WHERE RollNo = 1;

Query Practice Examples

SELECT * FROM Students;

SELECT Name, Grade FROM Students;

SELECT * FROM Students WHERE Age > 17;

SELECT * FROM Students ORDER BY Name;

Final Revision Checklist

- Understand keys: Primary, Candidate, Alternate, Foreign

- Memorize constraints: NOT NULL, UNIQUE, etc.

- Practice DDL and DML commands

- Learn SELECT with WHERE, ORDER BY, LIKE, etc.

- Review CREATE DATABASE and DESCRIBE TABLE syntax

You might also like