DBMS
DBMS
NUMERIC TYPES:- They are used for describing numeric values like mobile number, age, etc.
The different types of numeric data types available are-
1. Boolean (Yes/No) 6. Numeric
2. TinyInt (Tiny Integer) 7. Decimal
3. SmallInt (Small Integer) 8. Real
4. Integer 9. Float
5. BigInt (Big Integer) 10. Double
ALPHANUMERIC TYPES:-
The list of different data types available in alphanumeric types are
1. LongVarChar (Memo) (Long Text)
2. Char (Text-fix) (Small Text)
3. VarChar (Text) (Text of specified Length)
4. VarChar_IgnoreCase (Text) (Comparison are not casesensitive)
BINARY TYPES:-
Binary types are used for storing data in binary formats. It can be used for storing photos, music
files or (in general file of any format) etc.
The list of different data types available in Binary types are :-
1. LongVarBinary (Image)
2. Binary (Binary (fix)
3. VarBinary (Binary)
DATE TIME:-
Date time data types are used for describing date and time values for the field used in the table of
a database. It can be used for storing information such as date of birth, date of admission
etc.
The list of different data types available in Date Time type are:-
1. Date (Stores month, day and year information)
2. Time (Store hour, minute and second information)
3. Timestamp (Stores date and time information)
PRIMARY KEY:- A primary key is a unique value that identifies a row in a table. These keys are
also indexed in the database, making it faster for the database to search a record.
FOREIGN KEY:- The foreign key identifies a column or set of columns in one (referencing) table
that refers to a column or set of columns in another (referenced) table.
Note:- The “one” side of a relation is always the parent, and provides the PK(Primary Key)
Attributes to be copied. The “many” side of a relation is always the child, into which the
FK (Foreign Key) attributes are copied.
Memorize it : one, parent, PK (Primary Key) ; many, child , FK(Foreign Key)
There are two types of languages:-
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
Types of DML:-
1. Procedural: - The user specifies what data is needed and how toget it.
2. Non Procedural: - The user only specifies what data is needed.
Note: - A popular data manipulation language is SQL (StructuredQuery Language.)
In this article on SQL Commands, I am going to consider thebelow database as an example, to show
you how to write commands.
Employee_Info:-
ALTER TABLE
Employee_Info ADD
BloodGroup varchar(255);.
INSERT : This statement is used to insert new records into thetable.
INSERT INTO Employee_Info
VALUES ('02', 'Anay','Soumya', '9432156783', ' MarathalliHouse No 23', 'Delhi', 'India');
UPDATE : This statement is used to modify the records alreadypresent in the table
UPDATE Employee_Info
SET EmployeeName = 'Aahana', City= 'Ahmedabad' WHEREEmployeeID = 1;
DELETE : This statement is used to delete the existing records ina table
DELETE FROM Employee_Info WHERE EmployeeName='Preeti';
SELECT : This statement is used to select data from a database and the data returned is
stored in a result table, called the result-set.
SELECT EmployeeID, EmployeeName FROM Employee_Info;
(*) is used to select all from the table SELECT * FROMEmployee_Info;