Machine-translated by Google. Questions are authored in English.
Top

Introduction to SQL Questions and Answers

Answer: D

Correct answer: All of the above can be done by SQL.

SQL is a complete database language and covers all three. Creating structures is its data definition half, through CREATE, ALTER and DROP; querying and modifying data is its manipulation half, through SELECT, INSERT, UPDATE and DELETE.

A third part, data control, grants and revokes permissions. That breadth is precisely what made SQL displace the earlier database models, which needed separate languages for schema definition and for data access.

Please log in or register to report this question.

102.

When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s):

Answer: D

Correct answer: Both IN and NOT IN

A chain of OR conditions on the same column collapses into a single IN: state = 'VA' OR state = 'MD' OR state = 'DC' becomes state IN ('VA','MD','DC'), and its negation becomes NOT IN.

The gain is more than brevity. Long AND and OR chains need careful parenthesising, since AND binds tighter than OR and a missing bracket changes the meaning silently. IN removes the precedence question entirely. LIKE is for patterns and does not combine value lists.

Please log in or register to report this question.

103.

Select * from employee What type of statement is this?

Answer: A

Correct answer: DML

SELECT reads data from a relation without altering any structure, so it is a Data Manipulation Language statement.

DML has four members - SELECT, INSERT, UPDATE and DELETE - and SELECT is the only one that does not modify anything, which is why some texts place it in a query sublanguage of its own. A view would be created by a DDL statement, and an integrity constraint is a rule declared as part of a table definition.

Please log in or register to report this question.

104.

The wildcard asterisk (*) is the SQL-92 standard for indicating "any sequence of characters."

Answer: B

Correct answer: False

The SQL-92 wildcard for "any sequence of characters" is the percent sign %, used with LIKE, and the underscore _ matches exactly one character.

The asterisk does appear in SQL, but in the SELECT list, where SELECT * means all columns - a different construct entirely. It serves as a wildcard character in Microsoft Access, which departs from the standard, and a pattern written for Access silently returns nothing elsewhere because * is then matched literally.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Introduction to SQL Questions and Answers || Introduction to SQL MCQ Questions and Answers || Introduction to SQL GK Questions and Answers || Introduction to SQL GK MCQ Questions || Introduction to SQL Multiple Choice Questions and Answers || Introduction to SQL GK || GK on Introduction to SQL || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database