Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Q 1. What is programming language?

A set of symbols and commands is called as programming language

Programming language is of 2types i.e. Machine language (low level) & Human Language (high level)

Q 2. What is program?

A set of instructions is called as program

Q 3. What is low level language?

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

3.The translation speed of low-level language is very high

4. A programmer cannot easily debug these language

5.Examples are – Machine language & Assembly language

Q 4. What is high level language?

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

4.It is easy to debug

5.Examples are – Java , Python

Q 5. What is compiler?

1.Complier takes entire program as input

2.Memory requirement is more

3.Program needs to be complied every time

4.Errors are displayed after entire program is checked

5.Example --- C Compiler

6.Compiler debug the code at the end

Q 6. What is interpreter?

1. Interpreter takes single instruction as input


2. Memory requirement is less
3. Every time higher level program is converted to low level program
4. Errors are displayed after every instruction interpreted
5. Examples – BASIC
6. Interpreter checks the code line by line
7. It converts source code into machine code
Q 7. Difference btw delete and truncate?

1.Delete

1.Delete command is used to delete particular record from the table

2. Data can be recovered

3. Structure is available

2.Truncate

1.Truncate command is used to delete all record from table

2. Truncate is much faster than delete command

3. Data cannot be recovered

4. Structure is available

Q 8. What is constraint?

Constraint is used to control the structure of table

There are various types of constraints i.e

 Primary key
 Unique Key
 Foreign Key
 Not Null
 Default
 Check

1.Primary Key

1. It always considered unique value


2. It does not accept null value
3. It does not allow duplicate value
4. It is available to provide reference to another table
5. Only one primary key can be created in a table

2.Unique Key

1. It always considered unique value


2. It accepts Null value
3. It does not accept duplicate value
4. Multiple unique key can be made in a table

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

It is used to combined multiple tables together into a single table

Q 10. What is Built-In SQL?

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

1. ABS() Absolute value of a number


2. MODE()the variable x is divided by y and the remainder is returned
3. Truncate
4. Power
5. Sqrt
6. EXP() - returns e raised to the power of specific number

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()

You might also like