DBMS Notes Class 10
DBMS Notes Class 10
DBMS Notes Class 10
Well known DBMSs include Oracle, IBM DB2, Microsoft SQL Server,
Microsoft Access, PostgreSQL, MySQL, FoxPro, and SQLite.
Database Servers:
Database servers are dedicated computers that hold the actual databases
and run only the DBMS and related software.
Typically databases available on the database servers are accessed through command line or
graphic user interface tools referred to as Frontends.
Tables:
A table is a set of data elements (values) that is organized using a model of vertical
columns (which are identified by their name) and horizontal rows.
A table has a defined number of columns, but can have any number of rows.
This unique field is called the Primary Key (PK). A primary key is a
unique value that identifies a row in a table.
Foreign key
A foreign key is a key used to link two tables together. This is sometimes also
called as a referencing key.
The relationship between 2 tables matches the Primary Key in one of the tables
with a Foreign Key in the second table.
Binary Types:
Binary data types are used for storing data in binary formats. Binary data
types in a database can be using for storing photos, music files, etc. In
general, files of any format can be stored using the binary data type.
Ex:
BINARY, VARBINARY, LONGVARBINARY
Date time:
Date time data types are used for describing date and time values for the
field used in the table of a database.
Date time data types in a database can be used for storing information
such as date of birth, date of admission, date of product sale, etc.
Ex: DATE, TIME
SQL Commands:
The standard SQL commands to interact with relational databases are
CREATE, SELECT, INSERT, UPDATE, DELETE and DROP. These
commands can be classified into the following groups based on their
nature −
Syn:
Create table Table_Name( col_name1 datatype, col_name2 datatype,…….col_name_n
datatype );
Ex:
Create table student( rno int, name varchar(20), marks float);
Syn:
Ex:
Insert into student values(3,”RAVI”, 45);
Above command is used insert values for all columns in the table
or
Syn:
Insert into Table_Name( col_nam_1,col_name_2…..) values(val_1,val_2,…);
Ex:
Insert into student (rno,marks) values (10,47);
Above command is used to insert data for specific columns in the table
Syn:
Select * from Table_Name;
Ex:
Select * from student;
Above command displays all columns & rows from the table
Syn:
Select col_1,col_2,….col_n from Table_Name;
Ex:
Select rno,marks from student;
Above command displays specific columns & all rows from the table
DISTINCT
Syn:
Ex:
DESC
Desc Table_Name
Ex:
Desc items;
Alias NAME:
Syn:
Ex:
WHERE
Ex:
Select * from items where name=”pen”;
Select * from items where price>10;
Syn:
Ex:
BETWEEN
Syn:
Ex:
select * from items where code BETWEEN 15 and 20;
IN
Is used to place condition based on list values specified
Syn:
Ex:
select * from items where code IN (15,20);
LIKE
Order By:
To display table data in either ascending or descending order based on specific column
SyN:
Ex:
Select * from items order by price;
UPDATE
Syntax:
DELETE
Syn:
DROP
Syn:
Syn: