Font size
WorksheetsMySQL
Total questions: 94
Worksheet time: 47mins
Which of the following is described graphically using an E-R diagram?
Làm lại
Data flows between processes
Data source and destination
Entities and relationships between entities
Hierarchical data structure
SQL query and modification commands make up a(n)
XML
DML
HTML
DDL
A/an _________ is a piece of information that in some way describes an entity. It is a property of the entity and it quantifies, qualifies, classifies or specifies the entity.
Table
Process
ERD
Attribute
What is the purpose of a Unique Constraint?
To uniquely determine a table and columns within that table.
To identify a specific row within a table, using one or more columns and/or foreign keys.
Create an entity that is unlike any other entity aside from itself.
To identify one unique instance of an entity, by using one or more attributes and/or relationships.
Which of the following entities most likely contains invalid attributes?
Entity: Home. Attributes: Number of Bedrooms, Owner, Address, Date Built
Entity: Mother. Attributes: Name, Birthdate, Occupation, Salary
Entity: Car. Attributes: Owner Occupation, Owner Salary, Speed
Entity: Pet. Attributes: Name, Birthdate, Owner
In a 1:N relationship, the foreign key is placed in:
either table without specifying parent and child tables
the parent table
the child table
either the parent table or the child table
You are building a new database for a company with 10 departments. Each department contains multiple employees. In addition, each employee might work for several departments. How should you logically model the relationship between the department entity?
Create a mandatory one-to-many relationship between department and employee.
Create an optional one-to-many relationship between department and employee.
Create a new entry, create a one-to-many relationship from the employee to the new entry, and create a one-to-many relationship from the department entry to the new entry.
Create a new entry, create a one-to-many relationship from the new entry to the employee entry, and then create a one-to-many relationship from the entry to the department entry.
In a 1:1 relationship, the foreign key is placed in:
either table without specifying parent and child tables
the child table
either the parent table or the child table
the parent table
In which of the following can many entity instances of one type be related to many entity instances of another type?
One-to-One Relationship
Many-to-Many Relationship
One-to-Many Relationship
Composite Relationship
What data type is “Distance from home to school ”should be?
Decimal
Text
Bigint
Int
Which of the following is not an operator in categories of SQL Comparison Operators?
Not less than (!<)
Addition (+)
Less than or equal to (<=)
Not greater than (!>)
What is the storage size of smallmoney data type?
3 bytes
2 bytes
8 bytes
4 bytes
Từ NULLkhóa SQL được sử dụng để…
represent positive infinity.
represent negative infinity.
represent 0 value.
represent a missing or unknown value.
Which of the following SQL statements is used to delete both the structure and data of the named table STUDENT?
DROP TABLE STUDENT
REMOVE TABLE STUDENT
DELETE TABLE STUDENT
DELETE FROM STUDENT
Which one of the following deletes all the entries but keeps the structure of the relation.
Delete from instructor where dept name= ’Finance’;
Delete from instructor where salary between 13000 and 15000;
Delete from r where P;
Delete from instructor;
The SQL ALTER statement can be used to:
change the table structure
change the table data
add rows to the table
delete rows from the table
SQL data definition commands make up a(n) ________________
DDL
DML
HTML
XML
Identify the correct syntax for IDENTITY property?
Column-name Data type IDENTITY(SEED, INCREMENT)
Column-name Data type IDENTITY (???)
Column-name IDENTITY(SEED, INCREMENT)
Column-name Data type IDENTITY(INCREMENT)
A primary key constraint cannot be deleted if it is being referenced by a foreign key constraint in another table; the foreign key constraint must be deleted first?
True
False
A foreign key is:
a column containing the primary key of another table
all of the above are above correct
used to define data types
used to define null status
The difference between the DELETE and TRUNCATE SQL clauses is:
The DELETE clause deletes all rows in a database table, while the TRUNCATE clause can have a WHERE condition and might or might not delete all rows in a table.
The TRUNCATE clause is identical to the DELETE clause
The TRUNCATE clause deletes all rows in a database table, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table.
The TRUNCATE clause deletes table structure and it's all data, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table.
LOCATIONS(subject_code, department_name, location_id, city);
Which code snippet will alter the table LOCATIONS and change the datatype of the column CITY to varchar(30)?
ALTER TABLE locations MODIFY COLUMN (city varchar(30));
MODIFY TABLE locations ADD (city varchar(30));
ALTER TABLE locations ALTER COLUMN city varchar(30);
None of the above
Which of the following is not true about complex views?
They derive data from more than one table.
They contain no functions or grouping.
You cannot perform DML operations through a complex view.
All of the above are true.
Which of the following code will delete a view named all_marks_english?
delete view all_marks_english;
drop view all_marks_english;
delete all_marks_english
drop all_marks_english;
What is an index?
An index is the same as alias.
An index is a database table attribute, which speeds-up data search within a table.
An index is a special way to join 2 or more tables.
All of the above
Which is the purpose of index in SQL?
It leads to enchance the query performance.
It lead to provide an index to a record.
It lead to perform fast searches.
All of the above
Which one of the following is not true for a view?
They derive data from more than one table.
They contain no functions or grouping.
You cannot perform DML operations through a complex view.
All of the above are true.
In the UPDATE statement, if we do not use the WHERE clause, then:
Will not execute the update statement
All of the records will be updated
No records are updated
Only some records are updated
The SQL WHERE clause:
limits the column data that are returned.
limits the row data are returned.
Both A and B are correct.
Neither A nor B are correct.
The SQL keyword(s) ________ is used with wildcards.
IN and NOT IN
LIKE only
IN only
NOT IN only
Which of the following is true about the COUNT function?
COUNT(*) returns the number of rows in the table.
COUNT(exp) returns the number of rows with non-null values for the exp.
COUNT(DISTINCT exp) returns the number of unique, non-null values in the column.
All are true.
Which SQL keyword is used to remove duplicate rows in the result of an SQL query SELECT?
ORDER BY
SORT
UNIQUE
DISTINCT
Which of the following query is correct to select the highest salary of the employees in each Department?
SELECT e.dept_id, e.salary FROM Employee e GROUP BY e.dept_id ORDER BY MAX(e.salary);
SELECT e.dept_id, e.salary FROM Employee e GROUP BY e.dept_id ORDER BY MAX(e.salary);
SELECT e.dept_id, e.salary FROM Employee e GROUP BY e.dept_id ORDER BY MAX(e.salary);
SELECT e.dept_id, MAX(e.salary) FROM Employee e;
What is the difference between the WHERE and HAVING SQL clauses?
The WHERE SQL clause condition(s) is applied to all rows in the result set before the HAVING clause is applied (if present). The HAVING clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group.
The WHERE and the HAVING clauses are identical
The HAVING SQL clause condition(s) is applied to all rows in the result set before the WHERE clause is applied (if present). The WHERE clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group.
All of the above answers are not correct
What does the UNION operator do?
The UNION operator sorts the selected result set.
The UNION operator behaves the same as the JOIN SQL clause.
The UNION operator combines the results of two or more queries into one result that includes all the rows from the queries in the union.
All of the above
Which of the following query would show the total number of lines in the 'emp' table?
SELECT count_rows FROM emp;
SELECT totalrows FROM emp;
SELECT rowcount FROM emp;
SELECT count(*) FROM emp;
What is purpose of CAST function in SQL Server?
It converts or cast an expression of 1 data type to another
Add description to statement
It can not be in SQL Server
None of the above
Trong SQL, ABShàm được dùng để làm gì?
To return the absolute, positive value of a numeric expression.
To return the maximum value of a numeric expression.
To return the minimum value of a numeric expression.
The AVG SQL function returns the …
the sum of values in a column.
maximum value from a column.
average in the values in agroup.
minimum value from a column.
A data manipulation command the combines the records from one or more tables is called
PROJECT
JOIN
SELECT
PRODUCT
Which one is NOT type of Outer Join ?
LEFT (OUTER) JOIN
RIGHT (OUTER) JOIN
FULL (OUTER) JOIN
BOTH JOIN
We refer to a join as a self-join when?
we are using left and right join together
we are joining more than 2 tables
we are joining table to itself
We are joining two tables only
How many tables can be included with a join?
A. One
B. Two
C. Three
D. All of the mentioned options
Subqueries can be nested multiple times:
True
False
Which of the following statements is true concerning subqueries?
Involves the use of an inner and outer query
Cannot return the same result as a query that is not a subquery
Does not start with the word SELECT
All of the mentioned options
Which of the following is a correlated subquery?
Uses the result of an inner query to determine the processing of an outer query
Uses the result of an outer query to determine the processing of an inner query
Uses the result of an inner query to determine the processing of an inner query
Uses the result of an outer query to determine the processing of an outer query
Sub-queries can be nested in?
UPDATE statements only.
INSERT statements only.
DELETE statements only.
UPDATE, DELETE, INSERT and SELECT statements.
What does CTE stand for?
Control Table Expressions
Common Table Expression
Common Table Exception
Comon Triger Expression
Point out the WRONG statement.
The ROW_NUMBER function simply assigns sequential numbering to the records of a result-set or to the records groups of a result-set.
OVER clause is not required in all ranking functions.
SQL Server introduced four different ranking functions
All of the mentioned.
Which of the clause is not mandatory?
OVER clause.
ORDER BY clause.
PARTITION BY clause.
All of the mentioned.
Point out the WRONG statement.
RANK() returns the rank of each row in the result set of partitioned column.
DENSE_RANK() is same as RANK() function. Only difference is returns rank without gaps.
NTILE() distributes the columns in an ordered partition into a specified number of groups.
ROW_NUMBER() returns the serial number of the row order by specified column.
Which of the following function is used when you want all tied rows to have the same ranking?
RANK.
NTILE.
ROW_NUMBER.
None of the mentioned.
Which of the following SQL statements is used create database FASM in SQL Server?
DROP DATABASE FASM;
CREATE DB FASM;
CREATE DATABASE FASM;
CREATE NEW DATABASE FASM;
What is the purpose of the SQL AS clause?
The AS clause defines a search condition.
The AS clause is used with the JOIN clause only.
The AS SQL clause is used change the name of a column in the result set or to assign a name to a derived column.
All of the above answers are not correct
What is MS SQLServer?
Microsoft SQL Server is a database platform for online Transaction Processing (OLTP).
Microsoft SQL Server is a database platform for online Transaction Processing (OLTP), data warehousing, e-commerce application. It is also a business intelligence platform for data intergration, analysis, and reporting solutions.
Microsoft SQL Server is also a business intelligence platform for data intergration, analysis, and reporting solutions.
Microsoft SQL Server is a database platform for data warehousing, e-commerce applications.
What is components of MS SQL server?
Database Engine, Intergration Services, Reporting Services, Analysis Services.
Service Broker, Intergration Services, Replication Services, Analysis Services.
Service Broker, Intergration Services, Replication, Reporting Services, Full-Text Search.
Replication, Full-Text Search, Database Engine, Reporting Services, Analysis Services.
What is database engine?
Database Engine is supporting rapid analysis of business data
Database Engine is an application programing interface (API)
Database Engine is a complete set of tools that you can use to create and manage reports.
Database Engine is the core service for storing, processing, and securing data.
What is integration services (SSIS)?
Integartion Services (SISS) is support for messaging and queuing applications.
Integration Services (SISS) is a platform for building high performance data intergration solutions, including extraction, transformation, and load packages for data warehousing.
Integration Services (SISS) is developing applications that generate and send notifications.
Intergration Services (SISS) is synchronizing between databases to maintain consistency.
When execute the code, which message is printed:
Error:
Error: this field is not define
Error reporting system overflows in the @message variable
All answers are not correct
In any case, the following case is TRUE:
The output of the @sum variable is: 55
The loop never stops
The output of the @sum variable is: 0
The output of the @sum variable is: 1
Which code snippet will alter the table LOCATIONS and change the datatype of the column CITY to varchar(30)?
Làm lại
ALTER TABLE locations MODIFY COLUMN (city varchar(30));
MODIFY TABLE locations ADD (city varchar(30));
ALTER TABLE locations ALTER COLUMN city varchar(30);
None of the above
Now, tell the problem in query?
Above query is correct
Replace nothing with view name.
View name must be after keyword view and 'nothing' is not keyword, so should be replace with *.
Replace nothing with column names.
Which of the following is true?
10% price increase (UnitPrice) in the Products table, for products with a price of 60 or 70
10% price increase (UnitPrice) in the Products table, for products priced between 60 and 70
10% price increase (UnitPrice) in the Products table, for products priced between 60 and 70, excluding 2 values of 60 and 70
All answers are wrong.
1009, 1001, 1018
1009, 1018
1018
1001
Which SQL statement allows you to insert the following price of data into BOOK_INFORMATION?
Làm lại
ADD INTO BOOK_INFORMATION WITH (20, 'FRESHER ACADEMY SQL TUTORIAL ', 15);
INSERT INTO BOOK_INFORMATION USING (20, 'FRESHER ACADEMY SQL TUTORIAL', 15);
INSERT INTO BOOK_INFORMATION VALUES (20, 'FRESHER ACADEMY SQL TUTORIAL', 15);
ADD INTO BOOK_INFORMATION VALUES (20, 'FRESHER ACADEMY SQL TUTORIAL', 15);
Which SQL statement will you use to change the price for the BOOK titled 'ELEMENTARY SCHOOL GUIDE' to 20?
UPDATE BOOK_INFORMATION SET price = 20 WHERE book_title = 'ELEMENTARY SCHOOL GUIDE';
B. UPDATE TABLE BOOK_INFORMATION SET price = 20 WHERE book_title = 'ELEMENTARY SCHOOL GUIDE';
UPDATE TABLE BOOK_INFORMATION SET price = 20 WHERE book_id = 'ELEMENTARY SCHOOL GUIDE';
UPDATE BOOK_INFORMATION CHANGE price = 20 WHERE book_title = 'ELEMENTARY SCHOOL GUIDE';
Which of the following query statements is syntax error?
Result of the above two queries is:
8,8
6,6
7,7
None of the above
Which one is correct syntax for applying UNION operator:
By default, the order by clause lists items in ______ order.
Descending
Any
Same
Ascending
Which of the following SQL statements would find all books whose title starts with 'A'?
Which of the following SQL statements would list all stores that total sales amount is over 5000?
Which of the following query would display the lowest of cost in the Product table?
Select cost from Product where cost = min;
Select min(cost) from Product;
Select min(cost) from Product where cost = min(cost);
Select cost from Product where cost = min(cost);
Which of the following is true?
Count all of the bills
Count number of bills by the customer
List out number of bills by the date
The statement is syntax error
It will return:
Date & Time: Apr 4 2014 9:25AM
Date & Time: Mar 5 2014 9:25AM
Date & Time: Mar 4 2014 9:25AM
Date & Time: Apr 5 2014 9:25AM
To select students in the TH department with the highest average of score, which statement should you use?
Which code snippet will list the id and names of class with more than 15 students?
Which code snippet will display records with the following three columns: classId, className and amount (amount of students)?
S101, S101, S102, S103, S104, S104
S101, S101, S103, S104, S104
S101, S102, S103, S104
S101, S103, S104
INNER JOIN
CROSS JOIN
SELF JOIN
OUTER JOIN
All of the above
No rows
The 900 rows in the Customer table with matching rows in the SalesOrder table
The 1000 rows in the Customer table
None of the above
Fukuda, Oohira
Saito, Fukuda, Oohira
Tanaka, Suzuki
Tanaka, Suzuki, Saito
You need to implement a common table expression (CTE).
Which code segment should you use?
None of the above
101 rows will be returned without error.
10,001 rows will be returned without error.
101 rows will be returned with a maximum recursion error.
10,001 rows will be returned with a maximum recursion error.
