infs

Ace your homework & exams now with Quizwiz!

Que 40: Which command undo all the updates performed by the SQL in the transaction ?

ROLLBACK

Que 31: Which of the following query finds the names of the sailors who have reserved at least one boat ?

SELECT DISTINCT s.sname FROM sailors, reserves WHERE s.sid = r.sid;

With MySQL, how do you select a column named "FirstName" from a table named "Persons"?

SELECT FirstName FROM Persons

Which of the following is illegal

SELECT SYSDATE - (SYSDATE - 2) FROM DUAL; SELECT SYSDATE - (SYSDATE + 2) FROM DUAL; SELECT SYSDATE - SYSDATE FROM DUAL;

The NOT NULL constraint enforces a column to not accept NULL values.

True

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

True

In SQL, which of the following is not a data definition language commands

UPDATE

Which MySQL statement is used to update data in a database?

UPDATE

Which SQL statement is used to update data in a database ?

UPDATE

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?

UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

Que 42: The FROM SQL clause is used to

specify what table we are selecting or deleting data FROM

Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables

Data Definition Language(DDL)

Que 47: Which of the following SQL commands is used to retrieve data ?

SELECT

Which MySQL statement is used to select data from a database?

SELECT

With MySQL, how do you select all the columns from a table named "Persons"?

SELECT * FROM Persons

With MySQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?

SELECT * FROM Persons ORDER BY FirstName DESC

With MySQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

SELECT * FROM Persons WHERE FirstName LIKE 'a%'

With MySQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

SELECT * FROM Persons WHERE FirstName='Peter'

With MySQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?

SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

With MySQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?

SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

Que 28: Find all the cities with temperature, condition and humidity whose humidity is in the range of 63 to 79

SELECT * FROM weather WHERE humidity BETWEEN 63 AND 79

Que 30: Find the name of cities with all entries whose temperature is in the range of 71 and 89

SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89;

With MySQL, how can you return the number of records in the "Persons" table?

SELECT COUNT(*) FROM Persons

In SQL, which command is used to SELECT only one copy of each set of duplicable rows

SELECT DISTINCT

Which MySQL statement is used to return only different values?

SELECT DISTINCT

Que 32: Which of the following query finds the name of the sailors who have reserved at least two boats ?

SELECT DISTINCT s.sname FROM sailors s, reserves r1, reserves r2 WHERE s.sid = r1.sid AND r1.sid = r2.sid AND r1.bid <> r2.bid

Que 41: Which of the SQL statements is correct ?

SELECT Username, Password FROM Users

Find all the cities whose humidity is 89

SELECT city FROM weather WHERE humidity = 89;

Que 27: Find the temperature in increasing order of all cities

SELECT city, temperature FROM weather ORDER BY temperature;

Que 37: Which of the following is not true about creating constraints ?

Constraints are defined using the CREATE CONSTRAINT statement.

Que 34: Which of the following is true about Cartesian Products ?

A Cartesian product is formed when a join condition is omitted.

What is a view

A view is a virtual table which results of executing a pre-compiled query. A view is not part of the physical database schema, while the regular tables are.

In SQL, which command(s) is(are) used to change the storage characteristics of a table

ALTER TABLE

Que 48: Which of the following is NOT a type of SQL constraint ?

ALTERNATE KEY

Which of the following is a SQL aggregate function ?

AVG

Which operator is used to select values within a given range?

BETWEEN

Que 39: Which of the following command makes the updates performed by the transaction permanent in the database ?

COMMIT

Which of the following group functions ignore NULL values ?

COUNT SUM MAX

Which of the following code would create a role named student_admin ?

CREATE ROLE student_admin

Which MySQL statement is used to create a database table called 'Customers'?

CREATE TABLE Customers

Which of the following must be enclosed in double quotes ?

Column Alias

What is MySQL

Cross-platform, open-source and free Developed, distributed, and supported by Oracle Corporation A relational database management system

Which MySQL statement is used to delete data from a database?

DELETE

Which SQL statement is used to delete data FROM a database ?

DELETE

With MySQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?

DELETE FROM Persons WHERE FirstName = 'Peter'

Que 43: Which SQL keyword is used to retrieve only unique values ?

DISTINCT

Which of the following code will successfully delete the table LOCATIONS from the database

DROP TABLE locations

Which of the following is true about a group function ?

Group functions ignore null values

What are the supported types of joins in MySQL?

INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN

Which of the following SQL commands can be used to add data to a database table

INSERT

Which MYSQL statement is used to insert new data in a database?

INSERT INTO

With MySQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

INSERT INTO Persons (LastName) VALUES ('Olsen')

With MySQL, how can you insert a new record into the "Persons" table?

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

Que 45: What operator tests column for the absence of data ?

IS NULL operator

Which of the following is not true about the ALTER TABLE statement ?

It can add a new row

Which of the following is not true about Natural Joins ?

It selects rows from the two tables having different values in the matched columns.

Which operator is used to search for a specified pattern in a column?

LIKE

Which operator performs pattern matching ?

LIKE operator

Which SQL keyword is used to retrieve a maximum value ?

MAX

A command that lets you change one or more fields in a record is

Modify

If a query involves NOT, AND, OR with no parenthesis

NOT will be evaluated first; AND will be evaluated second; OR will be evaluated last

Which MySQL keyword is used to sort the result-set?

ORDER BY

Which SQL keyword is used to sort the result-set ?

ORDER BY

Que 29: Find the name of all cities with their temperature, humidity and countries.

SELECT weather.city, temperature, humidity, country FROM weather, location WHERE weather.city = location.city;

Que 35: Which of the following is not true about single-row subqueries ?

Single row subqueries return one row from the outer SELECT statement.

What is the full form of SQL

Structured Query Language

Que 38: Which of the following is not true about database synonyms ?

Synonyms are used for shortening lengthy object names. Synonyms can be created for tables, views, sequences, procedures and other database objects. A synonym is just an alternative name.

Que 44: A subquery can be placed in which of the SQL clause(s) ?

The WHERE clause The FROM clause The HAVING clause

Which of the following is not true about inserting new rows to a table ?

You cannot insert rows with NULL values to a table.

Que 36: Which of the following is true about removing rows from a table ?

You remove existing rows from a table using the DELETE statement

Which of the following is true about removing rows from a table ?

You remove existing rows from a table using the DELETE statement

Which of the following statements allows Deepak to change his database user account password to patel

alter user deepak identified by patel

Which of the following code will delete a view named all_marks_english ?

drop view all_marks_english


Related study sets

Spring 2019-POS2041-American Federal Government-01479 Midterm Study Questions

View Set

Orthodontic Assistant Terminology

View Set

Healthy Wealthy and Wise Chapter 2/3 Quiz

View Set