NEW
Font size
WorksheetsMID SEMESTER TEST
Total questions: 30
Worksheet time: 3hrs 30mins
A _____________ is a program running on the server machine, which accepts requests from a Web browser and sends back results in the form of HTML documents.
HTTP
HTML
Web Server
Web browser
Which of the following is not true about HTML ?
<meta…./>
<meta>…</meta>
<metadata name=”” />
<metadata>…</metadata>
Html document must always be saved with ________________.
.doc
.htm
.html
Both .htm and .html
What MySQL property is used to create a surrogate key in MySQL?
UNIQUE
SEQUENCE
AUTO_INCREMENT
None of the above.
The ORDER BY clause can only be used in ___________________.
INSERT queries
SELECT queries
HAVING queries
GROUP BY queries
In the following query, which expression is evaluated first?
SELECT id_number, (quantity - 100 / 0.15 - 35 * 20) FROM inventory
35*20
0.15-35
100 / 0.15
quantity – 100
Which of the following queries displays the sum of all employee salaries for those employees not making commission, for each job, including only those sums greater than 2500?
select job, sum(sal) from emp where sum(sal) > 2500 and comm is null;
select job, sum(sal) from emp where sum(sal) > 2500 and comm is null group by job;
select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;
select job, sum(sal) from emp group by job having sum(sal) > 2500 and comm is not null;
Which of the following queries are legal?
SELECT deptno, avg(sal) FROM emp;
SELECT deptno, avg(sal) FROM emp GROUP BY deptno;
SELECT deptno, count(deptno) FROM emp GROUP BY ename;
SELECT deptno, count(deptno), job FROM emp GROUP BY deptno;
DML changes are _______________________.
Insert
Create
Update
Both Insert and Update
_______________ joins are SQL server default.
Equi
Inner
Outer
None of the above.
Fill in with correct keyword to update the instructor relation.
UPDATE instructor
_____ salary= salary * 1.05;
IN
SET
SELECT
WHERE
Which of the following relation updates all instructors with salary over $100,000 receive a 3 percent raise, whereas all others receive a 5 percent raise.
UPDATE instructor
SET salary = salary * 1.03
WHERE salary > 100000;
UPDATE instructor
SET salary = salary * 1.05
WHERE salary <= 100000;
UPDATE instructor
SET salary = salary * 1.05
WHERE salary < (SELECT avg (salary)
FROM instructor);
UPDATE instructor
SET salary = CASE
WHEN salary <= 100000 THEN salary * 1.03
ELSE salary * 1.05
END
None of the above.
Which of the following deletes all tuples in the instructor relation for those instructors associated with a department located in the Watson building which is in department relation.
DELETE FROM instructor
WHERE dept_name IN 'Watson';
DELETE FROM department
WHERE building='Watson';
DELETE FROM instructor
WHERE dept_name IN (SELECT dept name
FROM department
WHERE building = ’Watson’);
DELETE FROM instructor
WHERE dept_name IN (SELECT dept name
FROM department
WHERE building = ’watson’);
Delete from r where P;
The above command will _______________________________________.
a) Deletes a particular tuple from the relation
b) Deletes the relation
c) Clears all entries from the relation
d) All of the mentioned
deletes the relation
clears all entries from the relation
deletes a particular tuple from the relation
All of the above.
Dates must be specified in the format of ___________________.
d/mm/yy
mm/dd/yy
yy/dd/mm
yyyy/mm/dd
Which one of the following is used to define the structure of the relation, deleting relations and relating schemas?
DDL
DML
Query
Relational Schema
Which one of the following provides the ability to query information from the database and to insert tuples into, delete tuples from, and modify tuples in the database?
DDL
DML
Query
Relational Schema
SELECT * FROM employee
What type of statement is this?
DDL
DML
View
Integrity constraint
CREATE TABLE employee (name VARCHAR, id INTEGER)
What type of statement is this?
DDL
DML
View
Integrity constraint
Here which of the following displays the unique values of the column?
SELECT ________ dept_name
FROM instructor;
IN
ALL
FROM
DISTINCT
SELECT * FROM employee WHERE salary>10000 AND dept_id=101;
Which of the following fields are displayed as output?
Salary
Employee
Salary, dept_id
All the field of employee relation
This is an Employee table.
1001 Annie 6000
1009 Ross 4500
1018 Zeith 7000
Which of the following employee_id will be displayed for the given query?
SELECT * FROM employee WHERE employee_id>1009;
1001
1018
1009, 1018
1009, 1001, 1018
Which of the following statements contains an error?
Select empid from emp;
Select * from emp where empid = 10003;
Select empid from emp where empid = 10006;
Select empid where empid = 1009 and lastname = ‘GELLER’;
In the given query which of the keyword has to be inserted?
INSERT INTO employee _____ (1002,Joey,2000);
Field
Table
Values
Relation
SELECT emp_name
FROM department
WHERE dept_name LIKE ’ _____ Computer Science’;
Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its ending string?
_
%
$
||
SELECT *
FROM instructor
ORDER BY salary ____, name ___;
To display the salary from greater to smaller and name in ascending order which of the following options should be used?
Asc, Desc
Desc, Asc
Ascending, Descending
Descending, Ascending
SELECT name
FROM instructor
WHERE salary <= 100000 AND salary >= 90000;
This query can be replaced by which of the following ?
SELECT name
FROM instructor
WHERE salary BETWEEN 90000 AND 100000;
SELECT name
FROM employee
WHERE salary <= 90000 AND salary>=100000;
SELECT name
FROM employee
WHERE salary BETWEEN 90000 AND 100000;
SELECT name
FROM instructor
WHERE salary BETWEEN 100000 AND 90000;
The if statement is used to execute some code only if a specified condition is true.
True.
False
The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true.
True.
False.
The NOT NULL constraint enforces a column to not accept null values.
True.
False.
