Which of the following queries will return the first 10% of the records in the salary table?
Question options:
select first 10% * from salary order by employee_id asc;
select percent(10) * from salary order by employee_id asc;
select top 10 % * from salary order by employee_id asc;
select top 10 percent * from salary order by employee_id asc;
Ans: select top 10 percent * from salary order by employee_id asc;
Explanation:
The correct syntax for selecting the top x % of the records in any table is:
SELECT TOP x PERCENT *
FROM Table_Name
WHERE condition;
Note : WHERE clause is optional.
For example, selecting top 30% of the records in STUDENT table is:
SELECT TOP 30 PERCENT * FROM STUDENT;
And all other options in the question will result in syntax errors.
Which of the following queries will return the first 10% of the records in the salary...
Which of the following queries on table STUDENT will return three values as a result? STUDENT Observe the table STUDENT: STUDENT StudentID SSN Name Class D111 111-11-1111 Connor Freshman D222 222-22-2222 Trevor Freshman D333 333-33-3333 Connor Sophomore D444 444-44-4444 Parker Sophomore D555 555-55-5555 Connor Sophomore Select one: a. SELECT name FROM student; b. SELECT class FROM student; c. SELECT DISTINCT name FROM student; d. SELECT name FROM student WHERE class != 'Sophomore';
Answer the following SQL study guide
questions...
Question 1 (1 point) Unless you assign a column name in the base table. the column name in the result set is the same as the 1) unique syntax 2) column alias 3) qualification 4) all of the above Question 2 (1 point) Which clause specifies the number of rows that should be skipped before rows are returned from the result set? 1) FETCH 2) OFFSET 3) FIRST 4) NEXT Question 3 (1...
Write SQL queries to answer the following question: A. Which students are enrolled in Database and Networking? (Hint: use SectionNo for each class, so that you can determine the answer from the Registration table by itself.) I have attempted the code below, but am receiving an error under the first SELECT, showing error code 1064, (syntax error) SELECT StudentName, StudentID FROM Student WHERE StudentID =(select StudentID FROM Registration WHERE (SectionNo=2714 OR SectionNo=2715) GROUP BY StudentID HAVING COUNT (*)>1;
QUESTION 32 Which statement can be used for conditional queries equal to if-then-else CASE WHERE DISTINCT DECODE 2.5 points QUESTION 33 The GROUP BY clause comes before the ORDER BY clause True False 2.5 points QUESTION 34 In the statement: SELECT Order_Item from orders o where order_id=1001; the "o" is a column alias table alias part of the column name a join operator 2.5 points QUESTION 35 Include which clause to this statement to return the null...
QUESTION 5 Suppose there are two tables: A and B. and we run command SELECT * from A LEFT JOIN B on A.orderid = B.orderid. What would be the code output? only the records from table A where tables A and B have the same orderid only the records from table B where tables A and B have the same orderid the complete set of records from table A, along with the matching records (depending on the availability) from table...
10-25. Write two HIVE queries, the first to create a PRODUCT table with fields ProdID, Name, Seller, Price; the sec- ond to load data into the table from file ProductInfo.csv. Make all necessary assumptions.
Top of Form Q1 Which of the following is a valid aggregate function in SQL? Check only those that apply. Question 1 options: AVG LEAST COUNT MIN MOST SUM Q2 Which of the following aggregate functions will only operate on a numeric value expression? Check only those that apply: Question 2 options: MIN MAX AVG COUNT SUM Q3 When applying DISTINCT to the value being calculated in an aggregate function like COUNT, what is the effect? SELECT COUNT(DISTINCT StreetName) FROM...
IN THE PREVIOUS CHAPTER WE MADE A DATABASE USING OUR LAST NAME
AS ITS NAME. QUESTION 1 STATES THIS.
PLEASE TYPE WHAT NEEDS TO BE TYPED FOR ALL STEPS. THIS USES
CODIO
a. 1. Connect to the database you created and named in Module One (for example, Jetson). Type after the prompt mysql> a. use (table you named); i. Example: mysql> use Jetson; 2. Create the Employee table using the SQL statement shown here. Press Return after each line. CREATE...
Which of the two following SELECT queries (a or b) of a geographic database is likely to be fastest in execution? Explain why a. Select all households living within 10om of a railway line, then from this group select all those who do not have a motor car Select all households without a motor car, then from this group select all those living within 10om of a railway line b.
1. Create a table that will hold the data in avgprice kwh state.csv. This .csv file contains the annual data from 1990-2012 on the average energy price per kilowatt hour (KwH) by state and provider type. Implement the following queries: • Print each row that has Tennessee as state, order the result by year in descending order. • Print the average residential, commercial, industrial, and transportation price for the state of Texas from the year 1990-2012. 2. Create the tables...