SQL
SQL
* A special language which is used for talking to and working with databases.Its like an set of instructions that helps you ask qu
Data - Data is raw,unprocessed facts,figures or information.
Database - A database is a structered collection of organized data used for efficient storage,retrieval and management.
Eg : In mobile contacts can be either saved internal or external but ultimately saved in mobile itself
Types of Database
Relational Database (RDBMS)
* A structered system for storing and managing data organized into tables with defined relationships.
Eg : Relation database is used for common column which is used to fetch the value needed,Also it is used to join the table kno
Register table
Roll No Name Branch
1 Uday CSE
2 Raj ECE
3 Kiran CIVIL
Fee table
Roll No Fee due
1 300
2 5000
3 150
Section
A
B
A
ned criteria or conditions. Eg SELECT * FROM ……(TABLE NAME) WHERE …(No of values)>…;(Semicolon)
R BY NAME; this is Ascending order, ORDER BY NAME; DESC; this is descending order[By default it takes ascending order)
Coverting two rows into single row
ons after using the "GROUP BY" [MORE THAN 2 USERS FROM A COUNTRY],Having can used when aggregate funtions are used.
ending order)
Different types ofCombining data from two or more tables based on related columns
Inner join Returns only the rows where there is a match in both tables joined, 1st it fetches the c
left join Returns all rows from the left table and the matched rows from right table,When there is
Right join Returns all rows from the Right table and the matched rows from left table,When there is
union
full join SELECT * FROM ACCOUNTS right JOIN LIKES1 ON ACCOUNTS.USERNAME= likes1.USERNAME;
ER CHAR(55);
RANCH VARCHAR(255);
SSER; [Gets deleted permanently in database including trash]
olumn BRANCH to COURSE;
cture,it delete only the rows values,columns will remain the same Eg TRUNCATE TABLE COURSES;
ons such as