Question

1.What is the return value if the user try to do the following:
SELECT TRUNC (65.73,-2) FROM DUAL;

Select one:

a. 60

b. 00

c. 0

d. 600

2.Supposed that the user uses the ff SELECT statement: what will be the possible output.
SELECT GRADE AS STUDENT MARK
FROM GRADE_REPORT;

Select one:

a. Error because of the keyword AS.

b. Error because of missing “” mark.

c. Will display the column GRADE rename as STUDENT MAK

d. Will display all rows and columns.

3.Suppose that a user uses the DELETE statement as shown below: what is/are the possible output.
DELETE from STUDENT;

Select one:

a. 0 rows are deleted.

b. All rows are deleted but the table is still intact.

c. All rows are deleted including table structure.

d. 0 rows are updated.

4.Suppose that the user wanted to add a new column name as CUST_NAME data type char size 6. What is the correct SQL statement to use?

Select one:

a. ALTER PARTS
ADD CUST_NAME CHAR(6);

b. ALTER PARTS
SET CUST_NAME = CHAR(6);

c. ALTER TABLE PARTS
ADD CUST_NAME CHAR(6);

d. ALTER TABLE PARTS
SET CUST_NAME = CHAR(6);

5.TABLE 1.0 ORGCHART ORG POSITION ID NAME 10 REYES, ANNA AMATHS PRES 15 AGAPITO, JUN SC SEC MEMBER 5 CRUZ, JOAN JPCS 12 DUQUE, ROAN JPCSMEMBER 21 LASON,MOJICA

Refer to table 1.0, suppose that user insert the following values using the statement below what would be the possible output? INSERT INTO ORGCHART VALUES (11,’YAMBAO,JUN’, NULL, NULL);

Select one:

a. The ORG and POSITION of YAMBAO will automatically sets to N/A.

b. Cannot insert the record because of missing values for ORG and POSITION.

c. The ORG and POSITION of YAMBAO will automatically sets to None.

d. The ORG and POSITION of YAMBAO will automatically sets to NULL.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. The answer for the command SELECT TRUNC (65.73,-2) FROM DUAL; is 0. For the function TRUNC, as we are passing a negative value of 2, it replaces two digits to the left of the decimal point by (c). 0. So, when it consecutively replaces two digits, it gives a result 0 not 00.

2. SELECT GRADE AS STUDENT MARK FROM GRADE_REPORT; This SQL query outputs an error message due to missing of " " around STUDENT MARK. If we are using it without quotes, the alias should be a single word either STUDENT or MARK or STUDENT_MARK. If we are putting a space in between then we must enclose it within quotes. So, the correct answer is, b. Error because of missing “” mark.

3. Correct answer: b. All rows are deleted but the table is still intact.

The command DELETE from STUDENT; deletes all the rows as no particular row is indicated using WHERE clause but the table is not deleted. Table structure, indexes and attributes still remain intact.

4. The correct answer is (c). ALTER TABLE PARTS ADD CUST_NAME CHAR(6);

When we are adding a new column to an already existing table, we should use ADD instead of SET. Again, in part (a) the key word TABLE is missing which is a part of the syntax in order to alter a table.

5. The query INSERT INTO ORGCHART VALUES (11,’YAMBAO,JUN’, NULL, NULL); outputs an error message. because of the value 'YAMBAO,JUN'. Because of this value it doesn't take input for columns ORG and POSITION. So, the correct answer is b. Cannot insert the record because of missing values for ORG and POSITION.

Add a comment
Know the answer?
Add Answer to:
1.What is the return value if the user try to do the following: SELECT TRUNC (65.73,-2)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 3. Write a script that adds rows to the database that you created in exercise 2....

    3. Write a script that adds rows to the database that you created in exercise 2. Add two rows to the Users and Products tables. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download_date column. Use the sequences created in the previous exercise to get...

  • 2. Write a script that implements the following design: In the Downloads table, the user_id and...

    2. Write a script that implements the following design: In the Downloads table, the user_id and product_id columns are the foreign keys. Create these tables in the ex schema. Create the sequences for the user_id, download_id, and product_id columns. Include a PL/SQL script to drop the table or sequence if it already exists. Include any indexes that you think are necessary. 3. Write a script that adds rows to the database that you created in exercise 2. Add two rows...

  • /* I am executing following SQL statement for the below code but I am getting error....

    /* I am executing following SQL statement for the below code but I am getting error. Pls, upload screenshot after running it. SQL Statement: SELECT OfferNo, CourseNo FROM Offering WHERE OfferTerm = 'Sum' AND OfferYear = 2012 AND FacSSN IS NULL; */ CREATE TABLE STUDENT( StdSSN INT NOT NULL PRIMARY KEY, StdFName VARCHAR2(50), StdLName VARCHAR2(50), StdCity VARCHAR2(50), StdState VARCHAR2(2), StdZip VARCHAR2(10), StdMajor VARCHAR2(15), StdYear VARCHAR2(20) ); CREATE TABLE FACULTY( FacSSN INTEGER NOT NULL PRIMARY KEY, FacFName VARCHAR(50), FacLName VARCHAR(50), FacCity...

  • PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do...

    PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do one of five things at a time: 1. Add students to database. • There should be no duplicate students. If student already exists, do not add the data again; print a message informing student already exists in database. • Enter name, age, and address. 2. Search for students in the database by name. • User enters student name to search • Show student name,...

  • What happens when you try to compile and run the following code? String query = "INSERT...

    What happens when you try to compile and run the following code? String query = "INSERT INTO Invoices (InvoiceDate InvoiceTotal) "              + "VALUES ('2/10/01', '443.55')"; Statement statement = connection.createStatement(); statement.executeUpdate(query); a. A SQLException is thrown at runtime because the executeUpdate method can’t accept a String object. b. A SQLException is thrown at runtime because the SQL statement is coded incorrectly. c. An error occurs at compile time because the SQL statement is coded incorrectly. d. This code compiles and...

  • Use the Concept of vector and string to do the following question 1) Write a program...

    Use the Concept of vector and string to do the following question 1) Write a program that creates a vector of string called V. Vector V grows and shrinks as the user processes the transactions from a data file called “data.txt”. The transaction file can only include three commands: Insert, Delete and Print. With Insert command, you get two more information, the information you need to insert and the position it should be inserted. With Delete, you get one more...

  • Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys...

    Learning Objectives: Learn to define constraints on tables Lean to define primary keys and foreign keys Exercise                                                                                In Lab 09, we will continue the practice of creating tables. You will need to write SQL statements for the tasks specified below. After you complete them, submit your SQL script (in one *.sql file) to Blackboard by 11:59pm Nov. 16 (Friday). Include your name as a comment in the SQL script submitted. The creation statement for each table is worth one point,...

  • Use python to code! Q1 - You need to keep track of book titles. Write code...

    Use python to code! Q1 - You need to keep track of book titles. Write code using function(s) that will allow the user to do the following. 1. Add book titles to the list. 2. Delete book titles anywhere in the list by value. 3. Delete a book by position. Note: if you wish to display the booklist as a vertical number booklist , that is ok (that is also a hint) 4. Insert book titles anywhere in the list....

  • * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following...

    * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...

  • Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there a...

    Use only a single SQL statement for each of the following questions 1 Give a listing of all the ssns,first names and the class descriptions of all the classes the students are taking. If there are no class _descriptions display 'No description is available yet'. (USE NVL) 2 Give a listing of only the lname and the class_code for students who are taking 'Introduction to C programming'. (Inner join) 3 Give a lising of all the class_descriptions and the number...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT