Professional Documents
Culture Documents
SQL Portion
SQL Portion
Programming language is of 2types i.e. Machine language (low level) & Human Language (high level)
Q 2. What is program?
1.This are machine friendly language and it is difficult for humans to understand
2.Low level language requires an assembler for directly translating their instructions of machine code
1.These are human friendly language that are easy to understand and used in todays time
2.High level language requires the use of a compiler or interpreter for their translation into machine
code
3.High level language take more time for execution as compared to low level language
Q 5. What is compiler?
Q 6. What is interpreter?
1.Delete
3. Structure is available
2.Truncate
4. Structure is available
Q 8. What is constraint?
Primary key
Unique Key
Foreign Key
Not Null
Default
Check
1.Primary Key
2.Unique Key
3.Foreign Key
1. Foreign key is taking reference from primary key of same or another table
2. Constraint helps to drop foreign key
3. For Seeing Constraint name
4. Select *from information_schema.table_constraints where table_name =””;
5. Creation create table table_name(id int,name char(20),constraint constraint_name
foreign_key() references parent_table(primary key))
Q 9. What is joins?
A join statement is used to combine two or more tables based on common field between them
Types of Joins:
1. Inner Join
2. Right Join
3. Left Join
4. Self Join
5. Union Join/Full Join
6. Cross Join
1.Inner Join
The inner join keyword select all rows from both the tables as long as the condition satisfies
2.Right Join
It returns all the record from the right table and matching values from the left table
3.Left Join
Left join is similar to right join , here left join returns all the record from left table and matching
values from the right table
4.Full Join
It select all the records from the right table as well as from the left table
5.Cross Join
1.String
2.Math
3.Aggregate
4.Date
1.String
1. Concat
2. Lower
3. Upper
4. Ltrim
5. Rtrim
6. Reverse
7. Remove
8. Replace
9. Length
2.Math
3.Date
1. Curdate()
2. Now()
3. Sysdate()
4. Datediff()
5. Month
6. Year
4.Aggregate
1. Avg()
2. Coount()
3. Min()
4. Max()
5. Sum()