Complex SQL Related Queries?

Problem 1:

If the rows coming from two tables are concatenated based on a specific condition, the operation is well know as

Selections:

1) Intersection
2) Difference
3) Restriction
4) Product
5) Join
6) Union
7) Without

Problem 2:
What’s the correct buy of clauses inside select statement
1) Select
2) Purchase by
3) where
4) having
5) Group By

Selections:
1) ONE, 2, THREE, 4, 5
2) ONE, 3, A FEW, 4, 2
3) ONE, 3, A FEW, 2, 4
4) ONE, 3, ONLY TWO, 5, 4
5) ONE, 3, ONLY TWO, 4, 5
6) ONE, 5, ONLY TWO, 3, 4
7) ONE, 4, ONLY TWO, 3, 5
8) ONE, 4, THREE, 2, 5

Problem 3:
Data Validation could be implemented at the data meaning stage through

selections:

1) Test constraints with specified values
2)Referential constraints by building foreign key for yet another table
3) Default value from the column
4) Not necessarily null constraint

Problem 4:
Production property needs a report concerning the sale wherever total sale on the day is greater than $20, 000.Which query ought to be used

selections:

1)select * through orders in which sum(amount) > 20000
2) select orderdate, sum(amount) through orders in which sum(amount) > 20000 order by OrderDate
3) select orderdate, sum(amount) through orders number by orderdate acquiring sum(amount) > 20000
4) select orderdate, sum(amount) through orders number by orderdate where by sum(amount) >20000

Problem 5:
Which from the following statements are completely wrong about most important keys

Selections:

1) Major key industry must incorporate unique values
2) Major Key industry can incorporate null prices
3) SOME SORT OF primary key is the column or pair of columns that makes every row within table unique
4) SOME SORT OF primary key could be created using the maximum involving three columns
5) Every single table provide a couple of primary keys
Distinctive key is another title for principal key

Problem 6:
What’s the order involving precedence amongst following operators

1) IN
2) NOT
3)AND
4)OR

Problem 7:
Examine your description from the STUDENTS table
STD_ID Number(4)
COURSE_ID varchar2(10)
START_DATE DATE
END_DATE DATE

The aggregate functions valid on the START_DATE coulumn are usually:

Selections:

1) SUM(START_DATE)
2) AVG((START_DATE)
3) COUNT((START_DATE)
4) AVG((START_DATE, END_DATE)
5) MIN(START_DATE)

Problem 8:
Which from the following operations is broken with admiration to dates

1) particular date + number
2) particular date * number
3) particular date – number
4) particular date – date
5) particular date + number24

Problem 9:

The Worker table uses alphanumeric characters for their Employee ID field, which often contains SIX digits prefixed together with 3 heroes.The alphanumeric characters consider the team code.
You need to generate a list of all this department limitations displayed within capital letters.
Which function(s) yoyu could use for this query

1) CONCAT()
2) SUBSTR()
3) UPPER()
4) LOWER()
5) REPLACE()

Problem 10:

Select all the appropriate options.

1) A table is a multiset regarding rows
2) SOME SORT OF table is a 2-dimensional variety of rows & columns
3) SOME SORT OF table is obviously dependent upon other tables
4) SOME SORT OF 3 usual form table is a table free of redundant data
5) A table need to have a major key.

Problem 11:

Study the rule given beneath:

SELECT employee_id VIA employees WHEN commission_pct =5 AND ALSO salary > 23000

Which on the following declaration is correct with regards to this program code.

1) The item returns staff members whose income is 50% over $23, 000
2) Them returns employees that have 50 PER CENT commission quote or salary in excess of $23000
3) The item returns staff members whose income is 52 % lower than $23000
4) None from the above

Problem 12:

Identify the wrong statement/s relating to constraints.

1) A primary crucial constraint could be disabled
2) More knowledge about the consatraint on the table might be retrieved via Data Dictionary
3) More knowledge about the columns what is the best the constraints are already applied an be gathered from records dictionary
4) There may be only one uniquie key in a table
5) If your column possesses null prices then your not null constraint can not be applied to the next column
6)There is usually a couple of primary crucial.

Problem 13:

Precisely how are Different indexes created

1) Automatically when a primary crucial is developed.
2) Automatically When a foreign crucial is created
3) Using create different index command
4) While using join different index command line.

Problem 14:

A dining room table has the next values because of its department industry:

marketing and advertising, production, output, sales, NULL, NULL, Marketing and advertising, NULL

What will the next query go back:

Select distinct(department) via employees;

1) marketing and advertising, production, sales
2) marketing and advertising, production, product sales, NULL
3)marketing, output, sales, NULL, NULL
4) marketing and advertising, production, product sales, NULL, Marketing
5)marketing, output, sales, NULL,, NULL, Marketing

Someone didn’t pay attention in course Homework was rather tough, eh

I’ll possibly be nice – here i will discuss a couple of answers.

Q1 :describes some sort of JOIN

Q5 :primary keys

1) Major key industry must incorporate unique prices TRUE
2) Major Key industry can incorporate null prices FALSE
3) SOME SORT OF primary key is the column or pair of columns that makes every row within table distinctive TRUE
4) SOME SORT OF primary key could be created using the maximum involving three columns FALSE
5) Every single table provide a couple of primary major FALSE
6) Different key will be another brand for main key FALSE An important factor can end up being unique without being key.

QUEEN 10 – Tables

1) SOME SORT OF table is a multiset with rows NOT SURE – MULTISET likely makes this particular FALSE
2) SOME SORT OF table is a 2-dimensional variety of rows & content – TRUE
3) SOME SORT OF table is obviously dependent upon other platforms – FALSE
4) THE 3 natural form table is a table free of redundant records – if discussing a solitary table, TRUE
5) A table need to have a major key.:FALSE

To the rest, you’re on your own.

Leave a Reply