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

27 08 2024

The document outlines the basic levels and operations of a Database Management System (DBMS), including creating, selecting, and deleting databases and tables. It details data types in SQL, the importance of primary keys, and provides syntax for creating tables and inserting data. Additionally, it explains how to display table structures and query data from tables.

Uploaded by

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

27 08 2024

The document outlines the basic levels and operations of a Database Management System (DBMS), including creating, selecting, and deleting databases and tables. It details data types in SQL, the importance of primary keys, and provides syntax for creating tables and inserting data. Additionally, it explains how to display table structures and query data from tables.

Uploaded by

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

27-08-2024

-------------

Levels of DBMS:
------------------

01. Database

table
Columns

-----------------------------------------------------------------------------------
-----------------

Database:
------------

01. Create

CREATE DATABASE <db_name>;

02. Select

USE <db_name>;

03. Remove/Delete

DROP DATABASE <db_name>;

04. Display/Show

SHOW DATABASES;

-----------------------------------------------------------------------------------
----

02. Tables

a. Data Types in SQL

1. INT
SMALLINT
MEDIUMINT
BIGINT

02. String ----> VARCHAR ---> 255 is max. character size

03. DATE ----> YYYY-MM-DD


04. DECIMAL ---> float

b. Primary Key

** Every table must have a primary key ----> field is unchanged

*** Table must be created under database ***

Syntax for creating table:


------------------------------

product

id

name

price

units

expiry date

category

CREATE TABLE <table_name> (

field_name data_type(size),

-------

PRIMARY KEY (FIELD_NAME)

);

02. Show structure of the table

DESC <TABLE_NAME>;

03. Show/Display all the tables

SHOW TABLES;
04. Delete/Remove

DROP TABLE <table_name>;

--------------------------------------------------------------------

03. INSERT ---> Add data (row) to the table

Syntax:
----------

INSERT INTO <table_name> VALUES (value1, value2,........);

** Before inserting the data, first check the structure of the table

------------------------------------------------------

04. SELECT ---> View Table data

Syntax:
---------

SELECT <field> FROM <table_name> [condition] [sorting][limit];

* ----> All fields

-----------------------------------------------------------------------------------
-----------------

Table ----> created ---> inserted ---> selected

-----------------------------------------------------------------------------------
----------------

You might also like