0

SQL Programming Language

Description: SQL Programming Language
Number of Questions: 15
Created by:
Tags: SQL Programming Language Database
Attempted 0/15 Correct 0 Score 0

The end of SQL command is

  1. System.exit()

    • Q
  2. an ‘enter key’ marker

  3. a semicolon(;)

  4. End


Correct Option: D
Explanation:

The sqlite3 program looks for a semicolon to know when your SQL command is complete.

Which SQL statement is used to extract data from a database?

  1. SELECT

  2. GET

  3. OPEN

  4. QUERY

  5. EXTRACT


Correct Option: A
Explanation:

SELECT" statement is used to extract the infromation from a database

In SQL, which of the following problems generally occur?

  1. The user had to have knowledge of the table and index structures.

  2. The same query can be written in many ways and varying internal execution plans.

  3. SQL syntax is too difficult.

  4. Independence of table relationships.

  5. The introduction of data redundancy.


Correct Option: B
Explanation:

the declarative nature of SQL makes it possible to write an individual query in many different forms, each with identical results. For example, a query he can be written with a standard join, a non-correlated sub-query or a correlated sub-query, each producing identical results but with widely varying internal execution plans.

You need to calculate the total of all salaries in the accounting department. Which group function should you use?

  1. MAX

  2. COUNT

  3. AVG

  4. VAR

  5. SUM


Correct Option: E
Explanation:

Computes the sum of the values in the column

SQL is used for interacting with _______.

  1. DBMS

  2. SDL

  3. RDBMS

  4. DDL

  5. MAQL


Correct Option: C
Explanation:

The Structured Query Language is the language used by programmers to interact with an RDBMS.

Which constraint can be defined only at the column level?

  1. UNIQUE

  2. NOT NULL

  3. CHECK

  4. PRIMARY KEY

  5. FOREIGN KEY


Correct Option: B
Explanation:

NOT NULL constraint restricts a column from having a NULL value. Once NOT NULL constraint is applied to a column, you cannot pass a null value to that column.

Which one of the following sorts rows in SQL?

  1. CUBE BY

  2. GROUP BY

  3. ROLLUP BY

  4. HAVING BY

  5. ORDER BY


Correct Option: E
Explanation:

SQL's ORDER BY clause organizes data in alphabetic or numeric order. Consequently, similar values sort together in what appear to be groups. However, the apparent groups are a result of the sort

Which operator perform pattern matching?

  1. BETWEEN OPERATOR

  2. NULL OPERATOR

  3. EXISTS operator

  4. Bitwise operators

  5. LIKE OPERATOR


Correct Option: E
Explanation:

Pattern matching is used to get the information without mentioning the full name and by just using the LIKE operator and just mention the starting letter.

Which statement creates a new user?

  1. CREATIVE USER susan;

  2. CREATIVE OR REPLACE USER susan;

  3. CREATE NEW USER susan DEFAULT

  4. CREATE USER sachin IDENTIFIED BY gupta;

  5. CREATE OR REPLACE USER susan IDENTIFIED BY blue;


Correct Option: D
Explanation:

The CREATE USER statement creates CREATE USER sqluser IDENTIFIED BY 'sqluserpw'.or each account, CREATE USER creates a new row in the mysql.user table and assigns the account no privileges.To assign a password, use IDENTIFIED BY with the literal plaintext password valu

Which of the following is used to join two or more tables based on a specified column value, that is not equal to a specified column value in another table?

  1. self join

  2. non Equi Join

  3. outer join

  4. natural join

  5. equi join


Correct Option: D
Explanation:

A natural join is a join statement that compares the common columns of both tables with each other.

Give the name of the cursor written and maintained by a database user.

  1. Explicit cursor

  2. User-defined cursor

  3. Implicit cursor

  4. User cursor

  5. Dynamic cursor


Correct Option: A
Explanation:

An explicit cursor is a named pointer to a private SQL area that stores information for processing a specific query or DML statemen

In a PL/SQL, block be executed by

  1. using %ROWTYPE

  2. using a slash (/)at the end

  3. using comma and a blank space

  4. using a semi colon at the end

  5. using slash-asterisk (/*)


Correct Option: B
Explanation:

the executable block and place a forward slash (/) after the closing END.

Which of the following is the name of index of SQL Server that stores index information in the system table ?

  1. sysindexes

  2. SYSIBM.SYSINDEXES

  3. sysusers

  4. sysconstraints

  5. sysobjects


Correct Option: A
Explanation:

The sysindexes system table stores system -level information about SQL Server indexes.

Which of the following is not a valid SQL type of identifier?

  1. SQL_VARCHAR

  2. SQL_NUMERIC

  3. SQL_INTEGER

  4. SQL_DOUBLE

  5. sql_create


Correct Option: E
Explanation:

CREATE TYPE registers a new data type for use in the current database. it is invalid identifier for sql.

Using SQL Server 2000, which of the following symbols is used to indicate parameters in stored procedures?

  1. @

  2. #

  3. %

  4. (_)

  5. $


Correct Option: A
Explanation:

@ is a stored procedure, you would set it before the query.

- Hide questions