0% found this document useful (0 votes)
3 views7 pages

Questions

Uploaded by

msardana90.can
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Questions

Uploaded by

msardana90.can
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

14, 31, 44, 45

Write a select statement that adds SALARY, COMM and BONUS together ( handling NULL
amounts) to get total income and create a FULLNAME column that displays the name
like this ( Ricetto, Darcy ) from the EMPLOYEE TABLE

What is the max number of bytes a varchar holds?

255

2555555

65535

68954

Write a statement to Insert a new record into the ACT table with the following
data: actno = 555 actkwd = Nov2 actdesc = midterm

How do you escape the % symbol in a LIKE in your WHERE clause?

Which of the following is not a a part of a CREATE statement?

ATTRIBUTE

DATA TYPE

RELATION

PROCEDURE

What does a PRIMARY KEY guarantee when you INSERT a record?

GRANULARITY

UNIQUENESS

SORTING

SPEED

Write a statement to delete a record from a table called LOGIC_GATE where the
MANUFACTURING_DATE of the record is in 2023 AND the PROCESSOR_DESCR starts with
INTEL and the QUANTITY isn't NULL.

Fill in the blanks : _______ ______ BOXERS( TEAM_NAME ________ (100),


JOINED_DATE _______) __
Write an SELECT statement to get the smallest SALARY and biggest COMM in the
EMPLOYEE table by WORKDEPT and JOB and sort it by WORKDEPT ?

"What is the result of this calculation where w is 44 x is 4.2 y is 8 and z is 2


round(ceil(x) * floor(x) / power (z,y) * sqrt(w),3)

0.518

0.829

0.522

0.714

What notation describes all of the possible parameters on Database Functions?

BNF

IRD

LBF

RTR

Create the ALTER statement to add the PRIMARY KEY on the first three columns of the
table : CREATE TABLE HR( HR_LIST_ID INT, RECRUITMENT_NUMBER VARCHAR(10),
POSITION_LOCATION VARCHAR(40), LOGGING VARCHAR(255))

What function do you use filter an aggregate value?

WHERE

HAVING

SORT

ORDER

Write a statement to convert a Date column called EMP_BIRTH_DATE to determine the


number of Years, Months ,Days that person has been alive ( each value as a separate
column)?

Where is the definition of all of your tables stored in the database?

THESAURUS

DICTIONARY

INDEX
CONTEXT

Write a statement to remove a DATABASE called MIDTERM and check whether it is there
so the statement doesn't error out

How do you separate multiple columns you are UPDATING?

SLASH

COMMA

TILDA

HASHTAG

What command do you use to remove a database you created?

DELETE

REMOVE

DROP

CLEANUP

Write a statement to ALTER a table called DAYSOFTHEWEEK and change its name to
DAYS_IN_THE_WEEK

What is the command to change a table name in an ALTER statement?

ALLOCATE

APPLY

RENAME

CHANGE

How many columns can you UPDATE in one statement?

10

255

as many as the table has

What condition would you use in the WHERE clause if you wanted to specify a list of
values?

ON

THROUGH

LIST

IN
What is the acronym that describes the category that a CREATE TABLE statement falls
in?

DRL

DDL

DBL

DTL

What column type would you use to store documents

VARCHAR

BLOB

DATE

CLOB

Write a select statement that averages the salary column from the staff table and
finds the COUNT COMM and COUNT BONUS. Include the ID and DEPT column. Limit the
SALARY by the AGGREGATED SALARY >30000

Fill in the blank with adding the COLUMN NOVEL_ID AND the FOREIGN KEY on that
column that REFERENCES the AUTHORS table and the ID NUMBER(10) column in that table
: CREATE TABLE LITURATURE(LITURATURE_ID NUMBER(10), NOVEL_NAME VARCHAR(300),
___________________________________)"

What is the result of this calculation where w is 36 x is 2 and y is 7 and z is


3.12 (sqrt(w) + mod(y,x) ) * abs(z)

3.6

2.184

2.2

2.188

What condition would you use in the WHERE clause if you wanted records with R in
the 4th spot and S 6th spot?

NAME LIKE '%R%S'

INSTR(NAME, 'R', 4) AND INSTR(NAME,'S',6)


NAME LIKE '___R_S%'

SUBSTRING( NAME, 6,1) || SUBSTRING(NAME,4,1) ='RS'

Write a statement to create a table STAFF_COPY which is an exact copy of the STAFF
table, and populate it with data from the STAFF table

Write the statements to drop the FIRSTNAME column from the EMPLOYEE table and ADD a
LOCATION (VARCHAR 10) to the EMPLOYEE table

What can I add to the end of a SELECT statement to force the WHERE clause to be
CASE sensitive?

What condition would you use in the WHERE clause if you wanted a wildcard search
with a specific number of characters?

UNDERSCORE

ASTERISK

PERCENT

TILDA

Fill in the blank to force the SALARY from greatest to least and the COMM from
least to greatest AND the GROUPING required : SELECT SUM(SALARY+ COMM), EMP_ID FROM
EMP ____________________________________________

"What is the acronym used to describe INSERTS, UPDATES, DELETES, CREATES AND
SELECTS"

SQL

BYOD

CRUD

SQIT

"What would be the result of this function ROUND(sqrt(8524),2) ?"

91

92

92.3

92.33

What is the command to change a string to the opposite of upper case in a SELECT?

BOTTOM
MIN

CAMEL

LOWER

How can you check if a record in a column is not empty?

IS NULL

IS BLANK

IS NOT BLANK

IS NOT NULL

Which of the following is not a a characteristic of a data model ?

PRECEDENCE

RELATIONSHIPS

SEMANTICS

CONSTRAINTS

Write an ALTER statement to add a column FIRST_NAME (VARCHAR 100) to a table


called STUDENT_ROSTER and add it after the column STUDENT_ID and add a second
column GRADE_POINT_AVERAGE NUMERIC(5,3)

What do I suggest you should do run before running an UPDATE/DELETE statement ?

Look at the columns data types

Make sure you are in the correct database

Run the where clause as a SELECT statement

Review the requirements of the question

What would I wrap around the column EXAM_VALUES to find out the number of
characters of each exam value and remove any leading or trailing spaces?

Write a SQL statement to count the number of EMPLOYEES by DEPARTMENT in the


EMPLOYEE table that belong to the 'IT Department'

What is the difference between SQL and MySQL?

What column type would you use to store the value : 294.88f

VARCHAR

NUMBER
DATE

FLOAT

Fill in the blank if I only want employees who have a JOINED DATE in the month of
July : SELECT ______ FROM EMPLOYEE WHERE _________JOINED_DATE = _________

You might also like