Database-MySQL [3i Infotech Placement]: Sample Questions 35 - 36 of 162

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 35

Edit

Describe in Detail

Essay▾

What is a Relation Schema and a Relation?

Explanation

Relation schema:

  • A set of attributes is called a relation schema (or relation scheme) .
  • A relation schema is also known as table schema (or table scheme) .
  • A relation schema can be thought of as the basic information describing a table or relation.
  • It is the logical definition of a table.
  • Relation schema defines what the name of the table is.
  • This includes a set of column names, the data types associated with each column.

A relation:

  • A relational database is a set of tables containing data fitted into predefined categories.
  • Each table (which is sometimes called a relation) contains one or more data categories in columns.
  • Each row contains a unique instance of data for the categories defined by the columns.

Question 36

Edit

Describe in Detail

Essay▾

What are the wildcards used for pattern matching?

Explanation

Undrstanding of Wildcards
  • Wildcard character is used to substitute other character in a string.
  • Used with SQL LIKE operator.
  • LIKE operator is used in a WHERE clause to search a specified pattern in a column.

Two wildcards used in LIKE operator:

  • %- Represent zero, one, or multiple characters.
  • _ - Represent a single character.

Syntax of %

SELECT FROM table_name

WHERE column LIKE ‘XXXX %’ or ‘% XXXX %’

Syntax of _

SELECT FROM table_name

WHERE column LIKE ‘XXXX_’ or ‘_XXXX’ or ‘_XXXX_’

Developed by: