hey Friends give me some questions of sql queries to form tables
Answers
Answer:
yeah I am friends with you.
please marks as brilanist answer bhejiye please
1) Which of the following option(s) is/are correct?
SQL is case insensitive
SQL is a programming language
A) 1
B) 2
C) Both 1 and 2
D) None of these
Solution: (A)
SQL is a querying language and it is not case sensitive.
2) What is true for a Null value in SQL?
Null +1 = Null
Null + 1 = 1
Null * 2 = Null
Null * 2 = 0
A) 1 and 3
B) 2 and 4
C) 1 and 4
D) 2 and 3
Solution: (A)
NULL represents a unknown value so adding anything to null value will give a null value in result.
3) Which of the following is not an aggregrate function in SQL?
A) MIN()
B) MAX()
C) DISTINCT()
D) COUNT()
Solution: (C)
All of the functions except DISTINCT function given in the question is an example of aggregate function.
6) Which of the following statements are true?
Query3 will give an error
Query3 will run smoothly
Query2 will give an error
Query2 will run smoothly
A) 1 and 3
B) 1 and 4
C) 2 and 3
D) 2 and 4
Solution: (B)
Query 2 is used for creating the view on table “Me” so it would run fine but if you run the Query3 it will generate the below error.
ERROR: cannot drop table me because other objects depend on it
DETAIL: view me_view depends on table me
HINT: Use DROP … CASCADE to drop the dependent objects too.
7) Now, you have changed the ‘Query3’ as below.
Query3: DROP TABLE Me CASCADE;
And, you also want to run below query on the same table.
Query4: select * from me_view;
Which of the following statements are true for such cases?
Query3 will give an error
Query3 will run smoothly
Query4 will give an error
Query4 will run smoothly
A) 1 and 3
B) 1and 4
C) 2 and 3
D) 2 and 4
Solution: (C)
If you drop the base table using cascade it will drop the base table as well as view table also so Query 3 will run fine but Query 4 will give an error.