Nếu không tìm thấy câu hỏi, hãy thử tìm bằng câu trả lời.
Which of the following is a legal expression in SQL?
Answer: SELECT NAME FROM EMPLOYEE;
The statement in SQL which allows change the definition of a table is:
Answer: Alter.
Which is the SQL constraint that allows inputting NULL in a specified column in a DBMS table but that does not allow inputting the already entered value?
Answer: UNIQUE
Which of the following product groups can be found when searching the “Product Inventory” table for products with a sales price of 500 dollars or more per unit and an inventory of less than 10 units?
Answer: Medium refrigerator, small refrigerator, and air conditioner
SQL stands for _____
Answer: Structured Query Language
Given below data in the Leased_Apartment_Table table
If the following statement is executed, which data group is extracted?
SELECT Property FROM Leased_Apartment_Table
WHERE (District=’Tu Liem’ OR Time_From_The_Station<15) AND (Floor_Space>60)
Answer: A, C
Which of the following is not the SQL statement?
Answer: DIVIDE
You want to create a table to store Microsoft Word documents. You need to ensure that the documents must only be accessible via Transact-SQL queries. Which Transact-SQL statement should you use?
Answer: CREATE TABLE DocumentStore
(
[Id] INT NOT NULL PRIMARY KEY,
[Document] VARBINARY(MAX) NULL
)
GO
Which of the following SQL statements defines a schema?
Answer: CREATE
There is a student score table shown below with basic and advanced subject codes which begin with letters B and A respectively. Which of the following SQL statements can be used to retrieve students, from the score table, whose basic subject score is 70 or more and examination date is 2007-05-04?
Answer: SELECT student_number FROM score_table WHERE score >=70 AND examination_date = ‘2007-05-04’ AND subject_code LIKE ‘B%’
Which of the following SQL statements can extract employee name’s whose salary is $10000 or higher from the table “human_resource”?
Answer: SELECT employee_name FROM human_resource WHERE salary>=10000
Which of the following is the appropriate SQL statement that is used to create Table A from Persons Table?
Answer: SELECT name FROM Persons WHERE country LIKE '%Korea%' AND gender = 'F' OR age = 26
SQL data definition commands make up a(n) _______
Answer: DDL
Which of the following operations extracts specific columns from tables in a relational database?
Answer: Projection
Which of the following SQL statements corresponds to the “projection” operation of the relational algebra that can extract only the column “Continent” from the table “Country” and eliminate duplicates from the records returned?
Answer: SELECT DISTINCT Continent FROM Country
You develop a database for a travel application. You need to design tables and other database objects. You create a view that displays the dates and times of the airline schedules on a report. You need to display dates and times in several international formats. What should you do?
Answer: Use the DATETIME2 data type.
Which of the following SQL statements for the stated table “Shipment_Record” produces the largest value as a result of its execution?
Answer: SELECT COUNT(*) FROM shipment_record
‘AS’ clause is used in SQL for:
Answer: Rename operation.
Your database contains a table named Purchases. The table includes a DATETIME column named PurchaseTime that stores the date and time each purchase is made. There is a non-clustered index on the PurchaseTime column. The business team wants a report that displays the total number of purchases made on the current day. You need to write a query that will return the correct results in the most efficient manner. Which Transact-SQL query should you use?
Answer: SELECT COUNT(*)
FROM Purchases
WHERE PurchaseTime >= CONVERT(DATE, GETDATE())
AND PurchaseTime < DATEADD(DAY, 1, CONVERT(DATE, GETDATE()))
You are a database developer of a Microsoft SQL Server database. The database contains a table named Customers that has the following definition:
You need to ensure that the CustomerId column in the Orders table contains only values that exist in the CustomerId column of the Customer table. Which Transact-SQL statement should you use?
Answer: ALTER TABLE Orders
ADD CONSTRAINT FX_Orders_CustomerID FOREIGN KEY (CustomerId) REFERENCES Customer (CustomerId)
Which of the following two descriptions on the operation of the stated customer_table is wrong?
Operation 1: SELECT CUSTOMER_NAME, ADDRESS FROM CUSTOMER
Operation 2: SELECT * FROM CUSTOMER WHERE CUSTOMER_NO = ‘D0010’
Answer: The table extracted by operation 2 has two columns
A primary key is combined with a foreign key creates:
Answer: Parent-Child relationship between the tables that connect them
You develop a Microsoft SQL Server 2012 database. The database is used by two web applications that access a table named Products. You want to create an object that will prevent the applications from accessing the table directly while still providing access to the required data. You need to ensure that the following requirements are met:
Future modifications to the table definition will not affect the applications' ability to access data.
The new object can accommodate data retrieval and data modification.
You need to achieve this goal by using the minimum amount of changes to the existing applications.
What should you create for each application?
Answer: Views
The database schema is written in:
Answer: DDL
Which of the following is a comparison operator in SQL?
Answer: All of the above
SQL is:
Answer: a data sublanguage.
The ______ operator is used to compare a value to a list of literals values that have been specified.
Answer: IN
Which of the following aggregate functions does not ignore nulls in its results?.
Answer: COUNT (*)