0% found this document useful (0 votes)
12 views11 pages

SQL Queries and Visualization Techniques

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views11 pages

SQL Queries and Visualization Techniques

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SQL and Visualization

1. Perform SELECT stud_id FROM students WHERE StudentName


LIKE 'y%'. It will give an output of:
a. It fetches the student id where the StudentName starts with “y”.
b. It fetches the student id where the StudentName column doesn’t
have“y”.
c. It fetches the student id where the StudentName has “y”.
d. It fetches the student id where the StudentName ends with “y”.

2. Trace the invalid SQL type?


[Link]
[Link]
c. NUMERIC
d. VARCHAR

3. Represent the correct order of the syntax:


a. FROM, SELECT,WHERE,GROUP BY,HAVING,ORDER BY,LIMIT
b. SELECT, FROM, GROUP BY, HAVING, ORDER BY , LIMIT
c. SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT
d. SELECT, FROM, WHERE, HAVING, GROUP BY, ORDER BY, LIMIT

4. Identify command to compare NULL values in SQL


a. IS NULL
b. IN NULL
c. Equal
d. None of These

5. The alternate name for SQL Views is

a. Virtual Tables
b. Simple Tables
c. Complex Tables
d. Actual Tables

6. Creating a copy of the table is performed by

a. Clone Table

b. Create Table

c. Insert INTO

d. Show Create Table

7. Creating a copy of the table is performed by

a. Clone Table

b. Create Table

c. Insert INTO

d. Show Create Table

8. Cite the difference between UNIQUE KEY and PRIMARY KEY

a. Unique Key cannot store NULL values but Primary Key can store
NULL values

b. A Unique key can be a date variable whereas a Primary Key


cannot.

c. We can have multiple Unique keys but only one Primary Key.

d. None of These.
9. Identify which statement is NOT used to filter data.

a. GROUP_BY

b. LIKE

c. LIMIT

d. WHERE

10. Determine the SQL function used to count the number of rows in
a query.

a. COUNT(*)

b. COUNT(a)

c. NUMBER()

d. SUM()

Subjective :

You have to find the customers who live on a street or a drive. What
is the command to do that? Table name customers.

11. Describe correct statement about "CREATE TABLE"

a. Datatype to a column can be assigned even after creating a table.

b. It is mandatory to insert at least a row while creating a table

c. It is necessary to assign a datatype to each column.


d. None of These.

12. Which of the following is the correct order of occurrence in a


typical SQL statement?

a. select, where, group by, having

b. select, group by, where, having

c. select, having, where, group by

d. select, where, having, group by

13. Employee table has 432 records. It has a UNIQUE non-NULL


SALARY column.

The statement SELECT COUNT(*) FROM Employee WHERE SALARY >


ANY (SELECT SALARY FROM EMPLOYEE);

will give an output of

a. 433

b. 432

c. 431

d. 0

14. Interpret the purpose of AS clause

a. It is used with JOIN clause only

b. It defines a search condition

c. It is used to change the name of a column in the result set or to


assign a name to derived column

d. All of the above.


15. Identify NOT available string type for a column.?

a. BIT

b. SET

c. CHAR

d. ENUM

16. In order to combine multiple retrievals, which keyword is used


between several SELECT statements?

a. JOIN

b. CONCAT

c. UNION

d. COMBINE

17. Which command removes all rows from a table without table
deletions?

a. Truncate

b. Delete

c. Alter

d. Update

18. What is the maximum number a SQL sequence can generate?

a. 38 digits

b. 48 digits

c. 0 digits
d. 32 digits

19. During a nested query if you have subquery inside a main query.
What is the sequence of execution?

a. Both the queries execute at same time.

b. Main Query.

c. Sub Query.

d. Only the main query is executed. The Subquery is never


executed.

20. Mention the role of "<>" syntax in SQL

a. Greater than Equal to

b. Less than Equal to

c. Equal to

d. Not Equal to

Subjective:

Visualize the following data frame, Create two tables, insert the
values, and write a query to find the salesman_name, and
commission of salespersons who receive a commission of less than
10,000.
21. How many different types of Normalization are there in SQL

a. Four

b. Three

c. Five
d. Two

22. Determine which of the following is not a logical operator in


SQL.

a. OR

b. ANY

c. AND

d. NOT

23. Complete the statement:

A Foreign Key is a column that

a. Can identify each row in the same table uniquely

b. Can identify each row in another table uniquely.

c. helps to validate the values of a column to check a condition

d. has to specify a value when no value is specified by the user.

24. SELECT select_list FROM table_list WHERE row_constraint


GROUP BY

grouping_columns; Which of these is not optional?

a. row_constraint

b. table_list

c. select_list

d. grouping_columns

25. Data warehouse contains_______data that is never found in the


operational environment.
a. normalized.

b. Informational.

c. summary.

d. denormalized.

26. An___________system is market-oriented and is used for data


analysis by knowledge workers, including managers, executives,
and analysts.

a. OLAP

b. OLTP

c. Both of the above

d. None of the above

27. In which of the following cases a DML statement is not


executed?

a. When existing rows are modified.

b. When a table is deleted.

c. When some rows are deleted.

d. All of the above

28. Find the cities name with the condition and temperature from
table ‘weather’ where condition is sunny or cloudy but
temperature is greater than 60.

a. SELECT city, temperature, condition FROM weather WHERE

condition = ‘cloudy’ AND condition = ‘sunny’ OR temperature


>= 60

b. SELECT city, temperature, condition FROM weather WHERE

condition = ‘cloudy’ OR condition = ‘sunny’ OR temperature >=


60
c. SELECT city, temperature, condition FROM weather WHERE

condition = ‘cloudy’ OR condition = ‘sunny’ AND temperature


>= 60

d. SELECT city, temperature, condition FROM weather WHERE

condition = ‘cloudy’ AND condition = ‘sunny’ AND temperature


>= 60

29. We apply the aggregate function to a group of sets of tuples


using the

_______ clause.

a. Group by

b. Group

c. Group set

d. group attribute

30. Which keyword is used to rename the resulting attribute after


the

application of the aggregate function.

a. Rename

b. As

c. Replace

d. to

Subjective:

Determine 5 difference between CURSOR and VIEW in SQL. (10)

You might also like