sql query aptitude questions and answers pdf

Sql Query Aptitude Questions And Answers Pdf

File Name: sql query aptitude questions and answers .zip
Size: 2316Kb
Published: 14.03.2021

A database is a collection of information in an organized form for faster and better access, storage, and manipulation.

SQL Online Tests

Q1 will result only empId e1. Q2 will result empId e1, e3 and e5. Note that if we use ALL in place of Any in second query then this will be correct. Option A is correct. Question 10 Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.

S2: Given the table R a,b,c where a and b together form the primary key, the following is a valid table definition. Foreign key declaration may have cascade delete which is not possible by just check insertion.

Using a check condition we can have the same effect as Foreign key while adding elements to the child table. But when we delete an element from the parent table the referential integrity constraint is no longer valid. So, a check constraint cannot replace a foreign key. Skip to content. Please wait while the activity loads. If this activity does not load, try refreshing your browser.

Also, this page requires javascript. Please visit using a browser with javascript enabled. If loading fails, click here to try again. Question 1. Question 1 Explanation:. But in question they seem to be talking about standard SQL not about implementation.

For example below is a P is correct in most of the implementations. In other words, all rows that satisfy the search condition make up a single group. See this for more details. S is correct. To verify S, try following queries in SQL. Question 2. Question 2 Explanation:. Question 3. How many tuples does the result of the following SQL query contains? Question 3 Explanation:. Age should be greater than all the values returned by the subquery.

So the subquery will return NULL. So all rows of table A are selected. Question 4. Consider a database table T containing two columns X and Y each of type integer. Let MX and My denote the respective maximum values of X and Y among all records in the table at any point in time. It may be noted that each time after the insertion, values of MX and MY change. What will be the output of the following SQL query after the steps mentioned above are carried out?

Question 4 Explanation:. Question 5. Question 5 Explanation:. Question 6. A relational schema for a train reservation database is given below. Question 6 Explanation:. When a subquery uses values from outer query, the subquery is called correlated subquery. The correlated subquery is evaluated once for each row processed by the outer query. The outer query selects 4 entries with pids as 0, 1, 5, 3 from Reservation table. Out of these selected entries, the subquery returns Non-Null values only for 1 and 3.

Question 7. Question 7 Explanation:. Question 8. Consider the following relational schema: Suppliers sid:integer , sname:string, city:string, street:string Parts pid:integer , pname:string, color:string Catalog sid:integer, pid:integer , cost:real Consider the following relational query on the above database: SELECT S.

Which one of the following is the correct interpretation of the above query? Find the names of all suppliers who have supplied a non-blue part. Find the names of all suppliers who have not supplied a non-blue part. Find the names of all suppliers who have supplied only blue parts. Find the names of all suppliers who have not supplied only blue parts. Question 8 Explanation:.

None option matched because given query returns suppliers who have not supplied any blue parts. That means it can include other than blue parts. A : False, as this may include blue parts and may not include "null" parts. B : Obviously false because it returning other than any blue part. C : Obviously false because it does not return this. D : Correct. Question 9. Consider the table employee empId, name, department, salary and the two queries Q1 ,Q2 below. Assuming that department 5 has more than one employee, and we want to find the employees who get higher salary than anyone in the department 5, which one of the statements is TRUE for any arbitrary employee table?

Q1 : Select e. Question 9 Explanation:. Here, Everyone means all of the group. Anyone means all or any part of the group. Let the employee empId, name, department, salary have the following instance.

Select e. Question Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL. Question 10 Explanation:. Check assertions are not sufficient to replace foreign key. So, we cannot replace it with a single check.

In above table definition, table S has a foreign key that refers to field 'a' of R. The field 'a' in table S doesn't uniquely identify a row in table R. You have completed. You have not finished your quiz. If you leave this page, your progress will be lost.

Attempted Questions Correct. We use cookies to ensure you have the best browsing experience on our website. Q1 is the correct query. Q2 is the correct query. Both Q1 and Q2 produce the same answer. Neither Q1 nor Q2 is the correct query.

SQL Quiz | SQL Online Test

Q1 will result only empId e1. Q2 will result empId e1, e3 and e5. Note that if we use ALL in place of Any in second query then this will be correct. Option A is correct. Question 10 Given the following statements: S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.

There is given sql interview questions and answers that has been asked in many companies. SQL is a standard query language used for maintaining the relational database and perform many different operations of data manipulation on the data. SQL initially was invented in It is a database language used for database creation, deletion, fetching rows and modifying rows, etc. It appeared in SQL is one of the often used languages for maintaining the relational database.

SQL - Questions and Answers

The question set is mostly the same between each version of the test; the differences are primarily in syntax for different DBMS, e. While peer reviewing a colleague's work, you stumble across the following SQL query, which is supposed to return how many subscriptions each of your customers has:. In order to properly compare candidates, they need to answer questions of the same difficulty level , and different questions always mean different difficulty levels. However, the order of questions and answers is randomized for each applicant.

SQL pronounced as 'es-q-el' is a standard computer language that is used to communicate with a database for querying, inserting, updating and modifying data stored in RDBMS. SQL is a standard query language that is used as a base to manipulate data from different databases like Microsoft Access, Sql Server, MySql, Oracle and many other relational databases. SQL has been enhanced in different database system. Like other programming languages, SQL also follows a predefined set of rules and guidelines called Syntax.

SQL Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews.

3 comments

Nadine M.

List of SQL Basic Aptitude Questions · 1) SQL stands for ______. Structured Query Language · 2) What is SQL? A high level programming language · 3) Which.

REPLY

Tyler W.

There are a lot of opportunities from many reputed companies in the world.

REPLY

Ouninatdrop

All students, freshers can download Database Introduction to SQL quiz questions with answers as PDF files and eBooks. Where can I get Database Introduction to​.

REPLY

Leave a comment

it’s easy to post a comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>